F
Frank
Hello!
I defined a class(CMyView1) based on CView from class wizard in VC2005, and
there're following code in .h file:
....
....
protected:
CMyView1(); // protected constructor used by dynamic creation
virtual ~CMyView1();
....
....
and then in MainFrm.cpp , there're
....
....
CView* pView = (CView*) new CMyView1; // error C2248
....
....
then the complier reported a error c2248, "cannot access protected member
declared in class 'CMyView1'", how do I solve the problem?
shall I just change the "protected" to "public" ? what's the meaning for the
comment line ? (protected constructor used by dynamic creation)
Thanks a lot!
Frank
I defined a class(CMyView1) based on CView from class wizard in VC2005, and
there're following code in .h file:
....
....
protected:
CMyView1(); // protected constructor used by dynamic creation
virtual ~CMyView1();
....
....
and then in MainFrm.cpp , there're
....
....
CView* pView = (CView*) new CMyView1; // error C2248
....
....
then the complier reported a error c2248, "cannot access protected member
declared in class 'CMyView1'", how do I solve the problem?
shall I just change the "protected" to "public" ? what's the meaning for the
comment line ? (protected constructor used by dynamic creation)
Thanks a lot!
Frank