Solved

DYNCREATE

Posted on 1998-03-13
6
1,008 Views
Last Modified: 2013-11-19
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!
0
Comment
Question by:jwilcox
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:AlFa
ID: 1316967
your MainWnd is private derived of CFrameWnd

class  MainWnd : CFrameWnd

just do this
class  MainWnd : public CFrameWnd


0
 
LVL 1

Author Comment

by:jwilcox
ID: 1316968
Sorry, its declared as MainWnd: public CFrameWnd, just an oversight on my part.
0
 
LVL 1

Author Comment

by:jwilcox
ID: 1316969
Edited text of question
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:AlFa
ID: 1316970
Do you have a creator and a destructor?

If you do not need one  declare an empty one :

MainWnd(){};
virtual ~MainWnd(){};
0
 
LVL 1

Author Comment

by:jwilcox
ID: 1316971
Yeah I do have a destructor and a constructor, thanks for your help anyways, though.

          Jason
0
 
LVL 23

Accepted Solution

by:
naveenkohli earned 30 total points
ID: 1316972
You have entered into deep troubled water of DYNCREATE macro. It shuld not be much of a hassle to come out of it.
Somehow your MainWnd () class is not able to find it parent window i.e. CObject because thats where DYNCREATE macro are implemented. Just go thru ur code and try to trace if you can reach back to cObject. Hopefully that shuld sole ur problem
The way its implemented is

CRuntimeClass * pRuntimeClass = RUNTIME_CLASS (CYourClass);
CObject *pObject = pRuntimeClass->CreateObject ();
ASSERT (pObject->IsKindOf (RUNTIME_CLASS (CYourClass));


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now