Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by DR00ME

"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
Posted

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.

[sIGPIC]e[/sIGPIC]
Posted (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 by DR00ME

"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

Posted
Once again PlausiblyDamp, your quality answer helped! thanks!

"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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...