简体   繁体   中英

Visual C++ Compiler error 2061

I am new to Visual C++ so please don't bite my head off. I can't figure out why I am getting this error. I have added an include of Parts.h in my Form1.h and I believe I have the correct code to call it. If anyone could help me to put this right I would be grateful.

This is the error:

Error   1   error C2061: syntax error : identifier 'Parts'  c:\users\*********\documents\visual studio 2005\projects\machinev.2\machinev.2\Form1.h  116

This is the code:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                 Parts ^Parts = gcnew Parts();
                 Parts->ShowDialog();
Parts^ parts = gcnew Parts();
parts->ShowDialog();

Don't use the same name for class and variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM