beginner: program corrupted somehow?
-
Hi, I was doing one of the beginning VC++ tutorials, and I added a member variable to a class by right clicking on the class name and choosing Add Member Variable from the context menu. However, I typed in the wrong name for the variable, so I wanted to delete it. There didn't seem to be a way to delete a variable using the Class Wizard, so I navigated to the variable in the header file, and I deleted it. However, when I tried to add the variable with the correct name (once again right clicking on the class name, and choosing Add Member Variable), a pop up box informed me the variable name could not be added. So, I added it by hand to the header file, as well as a few more variables, but when I went to build the project, I got 18 errors relating to the top of the .cpp file for the class. Is my only option to delete the whole program and start over? Below I included parts of the code with some comments: errors: ------------ ompiling... CodeProject_Dialog2.cpp C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(11) : error C2258: illegal pure syntax, must be '= 0' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(11) : error C2252: 'THIS_FILE' : pure specifier can only be specified for functions C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2838: illegal qualified name in member declaration C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2059: syntax error : 'return' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2238: unexpected token(s) preceding ';' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2143: syntax error : missing ';' before '*' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2501: 'GetMessageMap' : missing storage-class or type specifiers C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2556: 'int *__thiscall CCodeProject_Dialog2App::GetMessageMap(void) const' : overloaded function differs only by return type from 'const struct AFX_MSGMAP *__thiscall CCodePro ject_Dialog2App::GetMessageMap(void) const' c:\beginning c++\codeproject_dialog2\codeproject_dialog2.h(40) : see declaration of 'GetMessageMap' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2373: 'GetMessageMap' : redefinition; different type modifiers c:\beginning c++\codeproject_dialog2\codeproject_dialog2.h(40) : see declaration of 'GetMessageMap' C:\Beginning C++\CodeProject_Dialog2\CodeProjec
-
Hi, I was doing one of the beginning VC++ tutorials, and I added a member variable to a class by right clicking on the class name and choosing Add Member Variable from the context menu. However, I typed in the wrong name for the variable, so I wanted to delete it. There didn't seem to be a way to delete a variable using the Class Wizard, so I navigated to the variable in the header file, and I deleted it. However, when I tried to add the variable with the correct name (once again right clicking on the class name, and choosing Add Member Variable), a pop up box informed me the variable name could not be added. So, I added it by hand to the header file, as well as a few more variables, but when I went to build the project, I got 18 errors relating to the top of the .cpp file for the class. Is my only option to delete the whole program and start over? Below I included parts of the code with some comments: errors: ------------ ompiling... CodeProject_Dialog2.cpp C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(11) : error C2258: illegal pure syntax, must be '= 0' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(11) : error C2252: 'THIS_FILE' : pure specifier can only be specified for functions C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2838: illegal qualified name in member declaration C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2059: syntax error : 'return' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2238: unexpected token(s) preceding ';' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2143: syntax error : missing ';' before '*' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2501: 'GetMessageMap' : missing storage-class or type specifiers C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2556: 'int *__thiscall CCodeProject_Dialog2App::GetMessageMap(void) const' : overloaded function differs only by return type from 'const struct AFX_MSGMAP *__thiscall CCodePro ject_Dialog2App::GetMessageMap(void) const' c:\beginning c++\codeproject_dialog2\codeproject_dialog2.h(40) : see declaration of 'GetMessageMap' C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2373: 'GetMessageMap' : redefinition; different type modifiers c:\beginning c++\codeproject_dialog2\codeproject_dialog2.h(40) : see declaration of 'GetMessageMap' C:\Beginning C++\CodeProject_Dialog2\CodeProjec
The
class CCodeProject_Dialog2Dlg
declaration is missing the closing};
--Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- You cannot truly appreciate Dilbert unless you've read it in the original Klingon. -
The
class CCodeProject_Dialog2Dlg
declaration is missing the closing};
--Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- You cannot truly appreciate Dilbert unless you've read it in the original Klingon. -
Hi, Thanks for taking the time to look over my code. I really appreciate it. Thanks to you, my program now compiles. :)
Michael is really a good guy! a man with a lot of knowledge but also be willing to help beginners! This is really a good place here! learn a lot! not only knowledge, also friendship... ^.^ Nice to see you! Have every good day! :) You will when you believe!