I try to exit an application (need to know the base structure of Visual C++ program) but the code of the MSDN isn’t accepted. What am I doing wrong?
private: System::Void exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
}
Application::Exit(); };
The errors are on running this code:
error C3254: 'Program::Form1' : class contains explicit override 'Exit' but does not derive from an interface that contains the function declaration
error C2838: 'Exit' : illegal qualified name in member declaration
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
warning C4183: 'Exit': missing return type; assumed to be a member function returning 'int'
I could not find any helpful information on this, today is my first day with trying in VS 2008.
I think the Application::Exit(); is in the wrong line. Does the following work: