Link to home
Start Free TrialLog in
Avatar of jwilcox
jwilcox

asked on

DYNCREATE

I'm trying to user DYNCREATE in my MFC Application, unfortunatly I get the following errors:
Error C2509: 'CreateObject': member function not declared in MainWnd
Error C2509: '_GetBaseClass': member function not declared in MainWnd
Error C2039: 'classMainWnd: is not a member of MainWnd
Error C2248: '_GetBaseClass': cannot access protected member declared in class 'CFrameWnd'

MainWnd is delcared as MainWnd : public CFrameWnd
and I have IMPLEMENT_DYNCREATE(MainWnd, CFrameWnd) in my implementation file and DECLARE_DYNCREATE(MainWnd)

Any help would be appreciated!
Avatar of AlFa
AlFa

your MainWnd is private derived of CFrameWnd

class  MainWnd : CFrameWnd

just do this
class  MainWnd : public CFrameWnd


Avatar of jwilcox

ASKER

Sorry, its declared as MainWnd: public CFrameWnd, just an oversight on my part.
Avatar of jwilcox

ASKER

Edited text of question
Do you have a creator and a destructor?

If you do not need one  declare an empty one :

MainWnd(){};
virtual ~MainWnd(){};
Avatar of jwilcox

ASKER

Yeah I do have a destructor and a constructor, thanks for your help anyways, though.

          Jason
ASKER CERTIFIED SOLUTION
Avatar of naveenkohli
naveenkohli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial