Click here to Skip to main content
15,920,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Visual C++ with sql query problem in Visual Studio.net Pin
Anthony_Yio11-Dec-03 23:08
Anthony_Yio11-Dec-03 23:08 
GeneralKodak Image Edit Pin
satadru11-Dec-03 21:55
satadru11-Dec-03 21:55 
GeneralDialog boxes and views Pin
Sitaram Sukumar11-Dec-03 21:40
Sitaram Sukumar11-Dec-03 21:40 
GeneralRe: Dialog boxes and views Pin
Lido Paul11-Dec-03 21:52
Lido Paul11-Dec-03 21:52 
GeneralRe: Dialog boxes and views Pin
Sitaram Sukumar11-Dec-03 22:20
Sitaram Sukumar11-Dec-03 22:20 
GeneralRe: Dialog boxes and views Pin
Antti Keskinen12-Dec-03 1:27
Antti Keskinen12-Dec-03 1:27 
GeneralRe: Dialog boxes and views Pin
Sitaram Sukumar14-Dec-03 18:52
Sitaram Sukumar14-Dec-03 18:52 
GeneralRe: Dialog boxes and views Pin
Antti Keskinen15-Dec-03 0:25
Antti Keskinen15-Dec-03 0:25 
You MDI application consists minimally of following classes:

CMDIApp - This is your main application class, it is derived from CWinApp class.
CMDIFrame - This is your application's main window, a MDI Frame window. It is derived from CMDIFrameWnd class.
CMDIChild - This is one of your MDI child windows. They are derived from CMDIChildWnd class.

When you create new MDI child windows, you first construct their representative objects by either adding a static variable or using the new keyword on a pointer. After the object is constructed, you can call it's Create member method. The fifth parameter of Create is of type CMDIFrameWnd*. This is the address of the class, which is to be the parent of this newly created window. The framework uses this pointer to determine the associated window object and actually specify it as the parent, but we only need to pass the wrapper class's address.

Now, when you create new child windows, you usually call the Create member method from inside a function belonging to the CMDIFrame class, such as OnCreate or OnCreateClient. As you are calling from inside the class's context, the this pointer points to the calling object. Logically, you pass the this pointer as the fifth parameter to specify the calling object (and indirectly the associated window object) as the parent of the new MDI child window.

If you are not creating the child window from inside the context of the frame window class, then you can use the pMainWnd pointer, residing the in the application object, to refer to the main window of your application. This is usually the frame window. Naturally there are alternative methods, and many of them, such as using the extern keyword. What method you use is up to you.

Hope this will be helpful,
Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Dialog boxes and views Pin
Balkrishna Talele12-Dec-03 0:28
Balkrishna Talele12-Dec-03 0:28 
Generalsaving private processor Pin
R. Thomas11-Dec-03 21:03
R. Thomas11-Dec-03 21:03 
GeneralRe: saving private processor Pin
Peter Molnar12-Dec-03 9:59
Peter Molnar12-Dec-03 9:59 
Questionhow get CComboBox input Pin
google7311-Dec-03 20:15
google7311-Dec-03 20:15 
AnswerRe: how get CComboBox input Pin
l a u r e n11-Dec-03 20:26
l a u r e n11-Dec-03 20:26 
GeneralRe: how get CComboBox input Pin
google7311-Dec-03 21:13
google7311-Dec-03 21:13 
GeneralRe: how get CComboBox input Pin
Lido Paul11-Dec-03 21:45
Lido Paul11-Dec-03 21:45 
GeneralRe: how get CComboBox input Pin
google7311-Dec-03 22:40
google7311-Dec-03 22:40 
GeneralRe: how get CComboBox input Pin
Cedric Moonen12-Dec-03 1:14
Cedric Moonen12-Dec-03 1:14 
GeneralRe: how get CComboBox input Pin
Lido Paul13-Dec-03 14:14
Lido Paul13-Dec-03 14:14 
QuestionHow to detect driver's read/write attribute Pin
Lido Paul11-Dec-03 19:51
Lido Paul11-Dec-03 19:51 
QuestionHow to convert hWnd to CWnd Pin
Anonymous11-Dec-03 19:24
Anonymous11-Dec-03 19:24 
AnswerRe: How to convert hWnd to CWnd Pin
Jon Sagara11-Dec-03 19:43
Jon Sagara11-Dec-03 19:43 
AnswerRe: How to convert hWnd to CWnd Pin
Balkrishna Talele12-Dec-03 0:24
Balkrishna Talele12-Dec-03 0:24 
Generalenumeration of network & local printer from win 98 client machine Pin
skpanda11-Dec-03 19:21
skpanda11-Dec-03 19:21 
QuestionCan we find the address of pop3 server from an email address? Pin
huqian200211-Dec-03 18:50
huqian200211-Dec-03 18:50 
AnswerRe: Can we find the address of pop3 server from an email address? Pin
Johnny ²11-Dec-03 21:44
Johnny ²11-Dec-03 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.