Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DYNCREATE

Posted on 1998-03-13
6
Medium Priority
?
1,064 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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 90 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

721 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