VC++ and messagebox

DR00ME

Centurion
Joined
Feb 6, 2004
Messages
169
Location
Finland
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...
 
Last edited:
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.
Visual Basic:
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.
 
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...

Code:
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

			}
		}

        }
 
Last edited:
I'm sure it will. Sorry. I forgot about that problem when I posted my solution. It doesn't happen in C# 2005.
 
Back
Top