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 » Frame Features Tech Support » Saving the windowpos of child MDI frames does not work! Collapse All
Subject Author Date
Dominik Braendlin Oct 3, 2007 - 1:29 AM

Dear Tech Support
Our MDI application consists of a main frame e.g. CMainFrame and several child frames e.g. CMDIChildWnd.
I would like to save the main window position plus the last position of the child frames.
Saving the main window position is not a problem. Saving the window position of the child windows seams not to work.
I am using the following code snippet.
CWinApp * pApp = ::AfxGetApp();
ASSERT( pApp != NULL );
ASSERT( pApp->m_pszRegistryKey != NULL );
ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );


I found out that the m_dataFrameWP changes once the ProfileBarStateSave has been executed. It seems to me as if the m_dataFrameWP contains the window pos of the main window.
What am I doing wrong? Does my need for saving all the window positions go along with the philosophy of the ProfUIs framework or does it only allow me to save the main windows position but not the child windows position?
Is there an example on using the bEnableThrowExceptions if it is true? Try catch blocks.

Technical Support Oct 3, 2007 - 7:23 AM

The CExtControlBar::ProfileBarStateSave() method allows you to load the window position of the main frame window. This position is used in the <code>ActivateFrame() virtual method of the main frame class. This mechanism is not supported for MDI child frame windows because Prof-UIS does not know how many documents/views/MDI child frames are implemented in your project and how to identify each particular MDI child frame when loading/saving its window position. If you need MDI child frames to be persistent, this feature should be implemented in scope of your project as it is described in the following article:

Persistent Frames by Stefan Chekanov