|
-
March 28th, 2006, 10:16 AM
#1
Windows Form Handlers in CPP file?
Hi,
I'm trying to move all the windows form component handlers into a CPP from the generated Form1.h file. How can I do this? I'm using VC++ 2005.
I have tried so far to :
1/ Convert all the function definitions to prototypes.
e.g.
private: System::Void exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{}
>> to >>
private: System::Void exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e);
2/ Create a new cpp file, include all the required namespaces and header files. Including Form1.h
3/ Declare the function here and prefix the function name with the windows form class name.
e.g. System::Void Form1::exitToolStripMenuItem_Click (System::Object^ sender, System::EventArgs^ e)
{
// some code
}
Then, when I compile, I get the following error:
error C2653: 'Form1' : is not a class or namespace name
Any ideas what I am missing?
Regards,
Big Winston
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|