Click here to Skip to main content
15,921,884 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Should I be using struct instead? Pin
Navin10-Dec-03 4:49
Navin10-Dec-03 4:49 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 5:04
b_girl10-Dec-03 5:04 
GeneralRe: Should I be using struct instead? Pin
Big Art10-Dec-03 6:02
Big Art10-Dec-03 6:02 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 6:10
b_girl10-Dec-03 6:10 
QuestionHow to interpret Call stack window message ? Pin
Deepak Samuel10-Dec-03 2:35
Deepak Samuel10-Dec-03 2:35 
AnswerRe: How to interpret Call stack window message ? Pin
Mike Dimmick10-Dec-03 2:41
Mike Dimmick10-Dec-03 2:41 
GeneralDLL Dialog Pin
macmac3810-Dec-03 2:18
macmac3810-Dec-03 2:18 
GeneralRe: DLL Dialog Pin
Antti Keskinen10-Dec-03 3:04
Antti Keskinen10-Dec-03 3:04 
I cannot give you a direct code implementation, but I will discuss shortly on how a MDI program handles it's child windows.

First, we have the frame window, derived from CMDIFrameWnd. Then, you have a set of CMDIChildWnd objects placed in there. The main frame window is a MDI Frame. The child windows function similarly as a CFrameWnd does, except they rarely have toolbar of their own.

So, when in SDI application, a Frame window has one view, then in MDI application, a frame window has many child frames, which each have their own views. Do you understand this ?

Following this logic, the easiest way would be to create a CMDIChildWnd object in the DLL, and create a Form View to fill this window's view. This way, you would have two valid MDI child windows, from which the first would have a normal view and the other one a form view.

I would follow this approach, because I am unsure how a modeless dialog works when it is a child of a MDI frame window. I have never tested it myself. But using the CMDIChildWnd->FormView approach would give valid, working results, as both child windows would then be CMDIChildWnd objects, and would have all the necessary implementation ready for functioning as MDI childs.

When the windows are created, you must position them appropriately using SetWindowPos member of CMDIChildWnd. Just get the client rectangle of the parent frame (CMDIFrameWnd::GetClientRect), divide it to half X-wise, and use these values to determine the size and position of both windows. First window should be from (0, 0) -> (X / 2, Y) and the other from (X / 2, 0) -> (X, Y), where X and Y are the width and height of the client area, respectively.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: DLL Dialog Pin
macmac3810-Dec-03 4:46
macmac3810-Dec-03 4:46 
GeneralSearching in a DC Pin
Tommy2k10-Dec-03 2:05
Tommy2k10-Dec-03 2:05 
GeneralRe: Searching in a DC Pin
Antti Keskinen10-Dec-03 3:09
Antti Keskinen10-Dec-03 3:09 
QuestionHow to transparentize a window under Win9x? Pin
dot9910-Dec-03 1:31
dot9910-Dec-03 1:31 
AnswerRe: How to transparentize a window under Win9x? Pin
Antti Keskinen10-Dec-03 3:23
Antti Keskinen10-Dec-03 3:23 
GeneralRe: How to transparentize a window under Win9x? Pin
dot9910-Dec-03 3:53
dot9910-Dec-03 3:53 
GeneralRe: How to transparentize a window under Win9x? Pin
Antti Keskinen10-Dec-03 8:02
Antti Keskinen10-Dec-03 8:02 
GeneralRe: How to transparentize a window under Win9x? Pin
dot9910-Dec-03 12:09
dot9910-Dec-03 12:09 
AnswerRe: How to transparentize a window under Win9x? Pin
Member 36996310-Dec-03 12:17
Member 36996310-Dec-03 12:17 
AnswerRe: How to transparentize a window under Win9x? Pin
Anonymous10-Dec-03 18:35
Anonymous10-Dec-03 18:35 
Generallink with one of the multithreaded C run-time libraries. Pin
Caoimh10-Dec-03 1:30
Caoimh10-Dec-03 1:30 
GeneralRe: link with one of the multithreaded C run-time libraries. Pin
Rickard Andersson2010-Dec-03 2:04
Rickard Andersson2010-Dec-03 2:04 
GeneralRe: link with one of the multithreaded C run-time libraries. Pin
Caoimh10-Dec-03 2:16
Caoimh10-Dec-03 2:16 
GeneralRe: link with one of the multithreaded C run-time libraries. Pin
jmkhael10-Dec-03 2:06
jmkhael10-Dec-03 2:06 
GeneralRe: link with one of the multithreaded C run-time libraries. Pin
Mike Dimmick10-Dec-03 2:38
Mike Dimmick10-Dec-03 2:38 
GeneralUndo/Redo help required... Pin
satadru10-Dec-03 0:51
satadru10-Dec-03 0:51 
GeneralRe: Undo/Redo help required... Pin
Anonymous10-Dec-03 1:35
Anonymous10-Dec-03 1:35 

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.