How do I show a Win32 MessageBox?

visual-c++, visual-studio, winapi

Solution

You need:

MessageBox::Show("Hello World");

(Tested according to your instructions in Visual Studio 2005.)

Problem

I'm trying to make a pop up message box with "Hello World" written on it. I started off with File>New Project>Visual C++>CLR>Windows Form Application Then I dragged a button from the toolbox onto the form, double clicked it entered ``` private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { MessageBox("Hello World"); } ``` then I compiled... but I got an error message saying error C2440: '' : cannot convert from 'const char [12]' to 'System::Windows::Forms::MessageBox'

Original source