-
MDI Doc/View
OK I have a MDI application. My app doesn't bring up a MDI Child window at startup but it brings up a modeless dialog. The modeless dialog is created at startup from the CMainFrame class and has a button. When it is clicked I want to open up the MDI child window with view and document. I have never tried this before and is it a matter of getting document and then document template and then calling OpenDocumentFile(NULL);
I think I could probably get this to work eventually but it's giving me a headache then I wonder if it is right way or not. Thanks in advance.
jack
-
Re: MDI Doc/View
Why does it have to be modeless?
-
Re: MDI Doc/View
Such a technique is used when there are multiple document types. In that case, if you request a new document, first you open a dialog to ask the user about the kind of the document to open, then open it.
If you look for it, I think you can find somewhere in the MSDN a sample with that. It's done in the way you intend to do it.
-
Re: MDI Doc/View
Yes. Viewex sample on MSDN does closely what you are trying to do. However, it uses a modal dialog to open the documents.
Regards,
Bhushan
-
Re: MDI Doc/View
I'm wondering too why your inital window has to be a modeless dialog. Should it remain open after clicking the button? If not it can be modal and the solution is easy (as described in the post above).
With regards
Programartist
-
1 Attachment(s)
Re: MDI Doc/View
Hello,
I tried to achieve your original request:
In the applications InitInstance function I do not show the MDI frame.
Instead I show a modeless dialog.
In the modeless dialog I open either doc 1 or doc 2 (via button click(s)).
The modeless dialog remains open (until it or the app will be closed).
Each button click will show the (initially not shown) MDI frame.
I attached a demo project.
Unfortunalety I had to test it with the ancient VC6, but it should work the same way with the current versions.
With regards
Programartist
-
Re: MDI Doc/View
The reason it is modeless is because I need to be able to click stuff on the MDI Main frame window. Basically I have a MDI Frame window with a dialog bar and on the dialog bar is a TabCtrl. When you launch the app the Modeless dialog pops up which has numerous controls and a button. You can type in data to search a database. Once you hit the search button I want to hide the Modeless dialog and pop up the CMDIChildWnd and it's document and view. And you can switch through the numerous searches by clicking on the Tab Control. I guess instead of using a Modeless Dialog I could use a CFormview and use a MDI Child Window for that as well.
Jack
-
Re: MDI Doc/View
Dear left1none,
Where is the problem to look over my demo? I tried to implement exactly what you want to do. This took me a while and it is not worth any comment by you?
With regards
Programartist