Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on MDI: viewing two child windows at startup???

Status
Not open for further replies.

Sunny2

Programmer
Sep 11, 2003
15
CA
Hi I need help with creating a MDI application using MFC.

Well, if you create a MDI application on MFC, when the application starts you get one child window opened at start up. What I want is I want two child forms open at the same time. If anybody knows how to do that, that would be great. thanks in advance

Sunny
 
In the MDI model there is one per application MDI main frame windows and it contains a special child window called the MDICLIENT window.
The MDICLIENT window manages the client area of the main frame window, and itself has child windows: the document windows, derived from CMDIChildWnd.
I think you talk about these windows named document wiondows.
An MDI frame window (Frame window) works in conjunction with the current MDI child window, if there is one.
You can create many MDI child window but only one is active ( do not confuse with visible).
There are three ways to construct an MDI child window:

Directly construct it using Create().
Directly construct it using LoadFrame().
Indirectly construct it through a document template. (CDocTemplate , CMultiDocTemplate)
You can use MyFrameWnd::LoadFrame() to construct the MDI childs.
Use Use ::DestroyWindow(hWnd) to destroy a window.

-obislavu-
 
Hello Obislavu,

I am confused, I am just learning VC++. Well, I have this standard MDI with the default settings.

Well, I understand that the ChildFrame is derived CMDIChildWnd.

This is what I have for my ChildFrm.h file:

class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();

// Attributes
public:

// Operations
public:

// Overrides
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif

// Generated message map functions
protected:
DECLARE_MESSAGE_MAP()
};

I don't really understand how the child window is being created. So if you could explain to me exactly how to actually create the second child window I will appreciate it. Thank you so much in advance.

Sunny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top