Jump to content
Xtreme .Net Talk

inighthawki

Members
  • Posts

    14
  • Joined

  • Last visited

inighthawki's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. makes sense, thats a good idea, for now i was just returning them as string. Ill change it around, thx
  2. Im creating a set of useful functions, and one of them is to do the quadratic formula; however, if the result answer is imaginary, it returns NaN because it cant return imaginary numbers. My function normally returns a Double value, but what if u want it to return a string so it can display imaginary numbers? To do so i can code it to display (-B/2A) +- Sqrt(B^2 - 4AC) & "i" - simply put, but this is a string, and the function is a double. How can i make it so i can return both values? or do i have to make them all come back as strings?
  3. thx for the response, though plausiblydamp's idea did work, and as far as im concerned is fine for right now lol...
  4. i'll try later when i get the chance, thx for thr response, u guys alwasy seem to answer so quickly here reguardless the fact that nobody posts :P
  5. in vb.net, if i wanted to convert types, i could use directcast and return a value from say an object: Dim AL As ArrayList AL = DirectCast(BinaryFormatter.Deserialize(FileStream), ArrayList) and it could convert it to an arraylist, im trying to do the same in C++, but apparently C++ doesnt have the directcast function, and its not under the convert functions (::System::Convert::???) any help appreciated, thx in advance
  6. i had the idea of what to look for, but no idea how to do it, since i couldnt find a single online tutotial how to do so, only in C# it seemed to be, thx for the link, ill check it out
  7. bump...anyone with an answer how to do this?
  8. i have looked around and my best sources are telling me about the resource manager, but the problem is i simply cannot get it working. Does someone have any link or something or some info giving an example of how this works? or perhaps there's a better way in .net 2005 than 2003? In vb it was nice and easy - my.resources.<resource name> but obviously C++ doesnt have the my namespace... thx in advance
  9. ah ok thx marble eater, i found a thread b4 with something like what PlausiblyDamp wrote, but it didn't work, that ^ after the Control was the trick to it working.
  10. i am having some trouble transitioning a few things with C++ from vb, in vb, i could easily grab the text value from a button's sender property by declaring a variable as a control and grabbing it from there Dim c as Control = sender Dim s as string = c.text walla, however, obviously not so easy in C++, it gives me a cannot covert object -> control...anyone know exactly how to go about doing this?
  11. sry nm, i figured out my problem...simply needed the () after tostring...
  12. im a very big vb.net fan, very experienced in it, and i decided to start trying C++, yes big jump but im looking through tutorials, but i also like to experiment, and a lot of times tutorials dont answer certain questions. I have it set so when u click a button, it loads a simple function that u preset 2 numbers, and it returns the larger value, and sets the form's title to the larger number. When i try it gives me a cannot convert int -> sting, so i use the .tostring after the function, and it gives me error C2440: '=' : cannot convert from 'overloaded-function' to 'overloaded-function' can someone help/show me how to get this working? btw, this is the code: public: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { this->Text = this->FindMax(1,2).ToString; } int FindMax(int n1, int n2) { if (n1 > n2) { return n1; } else { return n2; } }
  13. ok thx a bunch, i completely forgot about that in vb cause i never used it that way :P
  14. OK, im a complete noob at C#, i came over from vb because of the slight similarities, and i wanted to learn C#...problem is im stumped already. In vb, to change the event it was as easy as selecting it in a drop box, or typing it in at the end of the sub declartion...in c# neither are anywhere to be found. For example, if i have a button on the form, when i dbl click on it to get to the code, it only gives me the option for what happens on Button1_Click, and no option for MouseOver, etc. The button is kinda a bad example because of its lack of useful events, but how would i accomplish changing this?
×
×
  • Create New...