Hello guys , i searched for over 2 hours how to add a messagebox when i click my button Visual C++ 2008 , in a windows app .. and i cant do it .. if any1 knows how to , please post and if anyone knows any guide or here any good tutorials around please post them ..


Regards

There's nothing to it MessageBox(NULL, "Hello This is a message box", "Help", MB_OK);

@Ancient Dragon , i have found this code but i get errors ... check them

1>path\visual studio 2008\projects\testing\testing\Form1.h(87) : error C2065: 'NULL' : undeclared identifier
1>path\visual studio 2008\projects\testing\testing\Form1.h(87) : error C2065: 'MB_OK' : undeclared identifier

Are you using managed code (CLR) ? Had you pressed F1 (Help) and searched for MessageBox you would have found the below in about 10 seconds. But instead you have wasted a couple days.

For CLR programs

MessageBox::Show( "Hello World -- this is a Message Box", "Help",
            MessageBoxButtons::OK, MessageBoxIcon::Exclamation );

Are you using managed code (CLR) ? Had you pressed F1 (Help) and searched for MessageBox you would have found the below in about 10 seconds. But instead you have wasted a couple days.

For CLR programs

MessageBox::Show( "Hello World -- this is a Message Box", "Help",
            MessageBoxButtons::OK, MessageBoxIcon::Exclamation );

this worked ... i dont ues CLR , i use Windows Form Application .. maybe its the same .. i dont know

If that worked then you created a windows CLR project.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.