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'
You need:
MessageBox::Show("Hello World");
(Tested according to your instructions in Visual Studio 2005.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With