J
Jack
Start fresh new default Windows .NET application and modify the
Form1 default constructor as follows (file "form1.h"):
Form1
{
InitializeComponent();
MessageBox::Show("Message","Test"); // This is new line added by me
}
The above code works OK. Now modify the code as follows:
In file "form1.h" change Form1 constructor from definition to
declaration as follows:
Form1();
In file "form1.cpp" add definition as follows:
Form1::Form1()
{
InitializeComponent();
MessageBox::Show("Message","Test");
}
Despite the fact that the #include "form1.h" is in form1.cpp this
change fails to compile in the above form or even in the form as
below:
Form1::Form1()
{
InitializeComponent();
System::Windows::Forms::MessageBox::Show("Message","Test");
}
The later version even helps you to build this code by pop-up cues,
but still fails to match proper .NET version of MessageBox during
compilation here and tries to use Windows API call instead which is
not what I want here.
What am I doing wrong ? Some expert, please help !!!
Jack
Form1 default constructor as follows (file "form1.h"):
Form1
{
InitializeComponent();
MessageBox::Show("Message","Test"); // This is new line added by me
}
The above code works OK. Now modify the code as follows:
In file "form1.h" change Form1 constructor from definition to
declaration as follows:
Form1();
In file "form1.cpp" add definition as follows:
Form1::Form1()
{
InitializeComponent();
MessageBox::Show("Message","Test");
}
Despite the fact that the #include "form1.h" is in form1.cpp this
change fails to compile in the above form or even in the form as
below:
Form1::Form1()
{
InitializeComponent();
System::Windows::Forms::MessageBox::Show("Message","Test");
}
The later version even helps you to build this code by pop-up cues,
but still fails to match proper .NET version of MessageBox during
compilation here and tries to use Windows API call instead which is
not what I want here.
What am I doing wrong ? Some expert, please help !!!
Jack