Friday, December 17, 2010

error C2512: 'class name' : no appropriate default constructor available

In MFC if we work on Single Document Interface(SDI). then if we wish our document to permanent storage then we add a macros in Doc.cpp file
"IMPLEMENT_SERIAL(classname,baseclassname,scemanumber)";

and some times we response a error message like this.

error C2512: 'classname' : no appropriate default constructor available
SDIView.cpp

and some times we confused that we will used constructor in this class. but this constructor is parametrized constructor to used default constructor simply by this method

classname(){}

your error is removed.



No comments:

Post a Comment