Archived

This topic is now archived and is closed to further replies.

MDI Dialogs

This topic is 5377 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a few questions about MDI programs. Question 1 Can I use Dialogboxes as child windows inside my program? I code the frame window and workspace window in pure win32 API calls but want to use Dialogboxes as childs. Question 2 How can I use accelerators on a dialogbox when my winmain looks just like this(Also, if I can use dialogboxes as MDI childs, how can I use it on the MDI childs aswell?)? Question 3 How do I add a toolbar to a dialogbox? It is not a avaliable inside the MSVC++ 6 dialogbox editor. I can add it to my MDI frame window using a CreateWindow call,but how do I add one to a dialog? Thx for the help in advance. Sand Hawk [edited by - sand_hawk on March 24, 2003 4:54:17 AM]

Share this post


Link to post
Share on other sites
I think he meant check the articles and examples on codeguru, they have some very good tutorials etc on how to accomplish specific things like what you talk of.

Share this post


Link to post
Share on other sites
Ok i guess Ill post something usefull too

Answer 1:

I am not sure if you can use dialogs directly as child frames, however if you derive your child window's view from CFormView, then they will be just like dialog's ie you can add the same controls onto them etc.


[edited by - Tylon on March 24, 2003 12:26:06 PM]

Share this post


Link to post
Share on other sites
Answer 3:

You can add a toolbar to a dialog too in exactly the same way you would for other window types, except you have to code it rather than the editor just plopping it in. Read up on CToolBar in the docs, it will tell you how to set it up and add it etc.

Share this post


Link to post
Share on other sites
Ah sorry, I just automatically assumed you meant MFC. Doing it using the Windows API purely would be very difficult. If you dont want to use MFC, you can look into other libraries such as http://www.wxwindows.org and many others; although the more basic ones dont always support MDI.

However if you know C++ and you have MSVC++6 (which you said you do) then MFC approach would probably be the simplest.

Share this post


Link to post
Share on other sites
Would it still be possible to get a dialogbox as MDI child? If that would be possible I am very glad so far. This is because I am doing a school project and for this I don''t have enought time to learn MFC. Maybe I''ll learn later.

Sand Hawk

Share this post


Link to post
Share on other sites
I dont know im afraid, I only have experience with MFC. Although I would expect a library such as wxWindows can do that. However, regardless of what library you use, you will have to learn that too. I personally did not find wxWindows that easy to use at all, its main advantages are that it is free and cross platform. Learning to use wxWindows can possibly take longer than learning MFC.

You can try searching for more libraries, but I think you will find that writing an MDI application in windows and C++ will always be difficult and require learning if you do not already have the knowledge.

Share this post


Link to post
Share on other sites
So far I am learning how to write MDI application in win32. I got the frame/client window all up and running. Now I just want to find out how to do the dialog boxes as childs.

Sand Hawk

Share this post


Link to post
Share on other sites