Skip to main content
gamedev.net
🔒 Locked

basic MFC creation question

Started by xropi Mar 12, 2003 at 3:07 PM 0 replies 650+ views
Original Post
xropi
xropi
HI! I decided to get MFC SDI modell and CD3DApplication together. (not trivial for me but I will do it) I started to learn MFC last weekend so I'm a beginner here. My question is a very basic one: I created an MFC SDI application that doesn't use doc/view architecture (for simplicity). Where my CChildView object is born? In MyApp::InitInstance() there is a line: CMainFrame* pFrame = new CMainFrame; The constructor of CMainFrame is empty so only CFrameWnd's constructor is called to do something. _Stepping over_ (F10) that lines I returned to CMainFrame's ctor's empty lines. _Stepping into_ (F11) at that point first the CStatusBar's then CToolBar's and at last my CChildView's ctor was called. WHY? In the source I couldn't see any lines that might initiate such an action. I've put here the related sections from the source:
    
class CMainFrame : public CFrameWnd
{
	
public:
	CMainFrame();
protected: 
	DECLARE_DYNAMIC(CMainFrame)

// Attributes

.
.
.
}

CMainFrame::CMainFrame()
{
	// TODO: add member initialization code here

	
}

    
How can my CChildView get instantiated? Thx. R [edited by - xropi on March 12, 2003 4:08:33 PM]
I'm interested in full featured 3D system development.
xropi
xropi
I''ve figured out the "great" trick: the CChildView object is member of the CMainFrame thus, when CMainFrame is created, its members are constructed too. :-)

R
I'm interested in full featured 3D system development.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.