Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to swap dialog's in a docking window Collapse All
Subject Author Date
Douglas Hoppes Aug 16, 2010 - 1:44 PM

Hi all,

I think that I have a simple request, but can’t seem to find code to do this. I have 6 different classes (ClassA, ClassB, ClassC, ClassD, ClassE, ClassF). Each class has a dialog class associated with it. The dialog class is sub-classed from CExtResizableDialog.

I also have a Manager class: ClassMgr. Based on a function call, this class will instantiate one of the 6 classes, get the dialog class associated with that called class, and then show it in my docking window.

Right now, the basic procedure is for me to create/destroy the docking window each time the ClassMgr function is called. Ideally, I would rather have the docking window initially created using the dialog of ClassA, then, every time one of the other classes need to be displayed, I would just replace the existing dialog with the new one.

Any ideas? Note: Due to memory constraints, I do not want to pre-create all of the dialog classes on startup.


Technical Support Aug 17, 2010 - 7:02 AM

The CExtControlBar window requires only one child window to be created inside it. So, you cannot create all your dialogs at once as children of one CExtControlBar window. If you need to replace one dialog with another, then you should destroy the old dialog (CWnd::DestroyWindow()) first. Then create new dialog and move it to cover entire bar’s client area. You can do this programmatically anytime you need to replace dialogs.