DR00ME Posted June 18, 2006 Posted June 18, 2006 (edited) heh I'm learning VC++ and I don't know if this question belongs here but anyway, how do I show for example integer value in a messagebox in VC++.. I couldn't find this information... regards... Edited June 18, 2006 by DR00ME Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
Leaders snarfblam Posted June 18, 2006 Leaders Posted June 18, 2006 Assuming that you are looking for a managed solution, are you using managed extensions for C++ (version 7) or C++/CLI (version 8)? This code should work in VC++ 8. int i; System::Windows::Forms::MessageBox::Show(i.ToString()); If you were using VC++ 7 the only difference that I can think of is that you might have to box the integer before calling ToString. Quote [sIGPIC]e[/sIGPIC]
DR00ME Posted June 18, 2006 Author Posted June 18, 2006 (edited) well umm I'm using visual studio 2003, and I got a normal application with a form... "....\Form1.h(273): error C2039: 'MessageBoxA' : is not a member of 'System::Windows::Forms'" I got this error when I rebuild... sorry for my english but what do you mean by "have to box the integer" ? the thing is that I got this structure with variables and I would like to show the values of these variables in this messagebox... private: System::Void menuItem8_Click(System::Object * sender, System::EventArgs * e) { if (joy_present) { DIDEVCAPS info; if (!FAILED(joy->GetDevCapabilities(&info))) { here I would like to popout a messagebox and show for example integer value of info.dwButtons } } } Edited June 18, 2006 by DR00ME Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
Administrators PlausiblyDamp Posted June 18, 2006 Administrators Posted June 18, 2006 http://www.winterdom.com/mcppfaq/archives/000128.html may hold the solution, if not let us know. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
DR00ME Posted June 18, 2006 Author Posted June 18, 2006 Once again PlausiblyDamp, your quality answer helped! thanks! Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
Leaders snarfblam Posted June 19, 2006 Leaders Posted June 19, 2006 I'm sure it will. Sorry. I forgot about that problem when I posted my solution. It doesn't happen in C# 2005. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.