Solved

Child windows not subordinated to the frame?

Posted on 1998-10-06
11
290 Views
Last Modified: 2013-11-20
Hi!

I would like to implement an application with several child windows, who behave like mainframes...
Compare to Outlook, where Outlook itself is a MainFrame with a menu and a treecontrol and a listbox. And every child of the frame (a single mail) is not bound to the mainframe...

What classes do I need? A MDIFrameWnd with FrameWnd as childs?  

Who can help me?

Thank you
0
Comment
Question by:Knallar
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 1

Expert Comment

by:Fargo
ID: 1323008
Yes you have to use the Multiple Document Interface (MDI) in your application. You can specify that, when you create your project with the MFC App Wizard. After doing so, the framework creates for you 3 classes connected to the MDI model: a document derived from CDocument, a main frame derifed from CMDIFrameWnd, and child frame class derived from the CMDIChildWnd. This is the answer to your question about the child windows. They SHOULD be derived from CMDIChildWnd, because this class works in conjunction with the MDICLIENT object, which is a member of the main frame window. And one thing more: in order to use the Document/View architecture, you have to create a CMultiDocTemplate object in your App's InitInstanse(). But this is just another thingie the AppWizard of VC++, that does for you.
I will recomend to create an MDI project with the AppWizard (just start it and read carefully and check everithing that's connected to the MDI). Then I will propose you to take a look at what MSDN says about the MDI architecture and what MFC classes are involved.

I hope, I was help :)
0
 
LVL 1

Expert Comment

by:Fargo
ID: 1323009
And by the way, the Outlook child windows are NOT child windows to the MainFrame, but they are separate applications. Take a close look to the taskbar, and you'll see that every new mail window is registered there, and if you have PView you'll find them as standalone applications. You can do that easy if you start the other applications (which represent the false childs) from the main window.
0
 

Author Comment

by:Knallar
ID: 1323010
Hmmmm fargo...
I didn't want MDIChilds...
I need to have childwindows, which can be placed anywhere on the desktop not only inside the CMDIFrameWnd.
If I use the common MFC-MDI-architecture, I get the case you described above.
But then my childs are inside the Frame and I'm not able to place them anywhere I like.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 8

Expert Comment

by:Answers2000
ID: 1323011
For outlook style UI, try this page
http://www.codeguru.com/advancedui/index.shtml

The articles that probably interest you are
#1 An Outlook98 bar-like control - Iuri Apollonio (1998/08/01)
#2 Outlook 98' style UI - Kirk Stowell (1998/08/22)

Article #1 creates a splitter in the mainframe (actually a derived class of CSplitterWnd) and then a custom control in the LHS

Article #2 is probably more directly relevant to your question as I undertand it
0
 
LVL 1

Expert Comment

by:Fargo
ID: 1323012
Hmmmm knallar...
Did you read my comment? You want to create some pop-up child windows...
Let me think...you can do something over the window style of the child windows. But see what the MS documentation states about the window styles (and let me notice that this is a part of the A-B-C of the Windows programming):

WS_CHILD :
Creates a child window. Cannot be used with the WS_POPUP style.
 
WS_POPUPWINDOW:
Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.

.and to be more clear, I include the description of what a pop-up window is:

pop-up window :
A special type of overlapped window typically used for dialog boxes, message boxes, and other temporary windows that appear outside an application's main window.

So, you CANNOT create a CHILD window that is POP_UP also
PLEASE READ MY PREVIOUS COMMENT.
I'm sorry that I was not helpful, but as I stated already you can start your "child" windows as standalone applications as your favourite Outlook does.

Sincerly yours
Fargo
0
 
LVL 1

Expert Comment

by:Fargo
ID: 1323013
Hmmmm knallar...
Did you read my comment? You want to create some pop-up child windows...
Let me think...you can do something over the window style of the child windows. But see what the MS documentation states about the window styles (and let me notice that this is a part of the A-B-C of the Windows programming):

WS_CHILD :
Creates a child window. Cannot be used with the WS_POPUP style.
 
WS_POPUPWINDOW:
Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.

.and to be more clear, I include the description of what a pop-up window is:

pop-up window :
A special type of overlapped window typically used for dialog boxes, message boxes, and other temporary windows that appear outside an application's main window.

So, you CANNOT create a CHILD window that is POP_UP also!
PLEASE READ MY PREVIOUS COMMENT.
I'm sorry that I was not helpful, but as I stated already you can start your "child" windows as standalone applications as your favourite Outlook does.

Sincerly yours
Fargo
0
 
LVL 3

Expert Comment

by:plaroche
ID: 1323014
To have child windows not subordinated to the frame you don't really have to start other applications.  It can be done also by making you popup child windows children of the desktop window.

You retrieve the desktop window with GetDesktopWindow(), use that pointer as a parent to the child window you will create.  Beware not to store the pointer across messages, it may become invalid. You can safely store the HWND though.

Doing this will also make a new icon for the window on the taskbar. And it will also make the windows standalone.
0
 

Author Comment

by:Knallar
ID: 1323015
O.K... sounds logical...

Now... simply tell me what special classes of the mfc I have to use...
A CFrameWnd and as the new "child" also a CFrameWnd with it's parent set to the desktopwindow?
0
 
LVL 1

Expert Comment

by:Fargo
ID: 1323016
Knallar, do you want me to go there (whereever you are) and develop the prog for you?
If so, just send me your address (country, state, street...etc.) and I'll be there in a minute...
0
 
LVL 3

Accepted Solution

by:
plaroche earned 50 total points
ID: 1323017
Use a simple CWnd derived class, or even a dialog or anything you wish. It all depends on what you need to do.

As for Outlook, let's say you wanted the same behavior well you could create a childframe and let have it float with the parent as desktopwindow
0
 
LVL 1

Expert Comment

by:Fargo
ID: 1323018
...And no special classes. You guessed it would be CFrameWnd window with the styles and actions plaroche proposed you. I don't understand, why you reject answers that seem logical to you?!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
not able to insert into temp table 68 162
fizzArray2 challenge 1 79
has77  challenge 9 83
unix example issues 18 90
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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