Forum
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.
Subject |
Author |
Date |
|
Jia Hong Li
|
Mar 23, 2007 - 3:17 AM
|
Problem is due to the following code snippet: //////////////////////////////////[ MainFrm.cpp ]////////////////////////////////////// ... int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) ... if( !CExtControlBar::ProfileBarStateLoad( this, pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName, &m_dataFrameWP ) ) ... //////////////////////////////////////////////////////////////////////////////////////////
Before I comment it: http://picasaweb.google.com.tw/ooy.yoo/Others/photo#5045042836215407762 No problem
After I comment it: http://picasaweb.google.com.tw/ooy.yoo/Others/photo#5045043012309066930 The maximize function seem to calculate out the wrong location
What extra infomation should I provide to you ?? Because this problem is due to regeistry, I have no idea.
|
|
Jia Hong Li
|
Mar 26, 2007 - 1:44 AM
|
This problem can be resolve by other ways:
If I use: g_PaintManager.InstallPaintManager( RUNTIME_CLASS(CExtPaintManagerOffice2003NoThemes) ); everything work fine.
But if I use: g_PaintManager.InstallPaintManager( RUNTIME_CLASS(CExtPaintManagerOffice2007_Black) ); Maximize problem happen
|
|
Technical Support
|
Mar 26, 2007 - 12:08 PM
|
Would you send us a screenshot demonstrating the incorrect window placement on the screen? Does the problem occur in our samples?
|
|
Jia Hong Li
|
Mar 26, 2007 - 8:28 PM
|
This problem is fixed in v2.641, but our project run in 2.641 is a little slow.
|
|
Technical Support
|
Mar 29, 2007 - 11:26 AM
|
We confirm the problem with a slow start. We are working of this issue and will notify you additionally when it is fixed.
|
|
Jia Hong Li
|
Mar 29, 2007 - 8:25 PM
|
I found the problem.
That is if I use g_PaintManager.InstallPaintManager( RUNTIME_CLASS(CExtPaintManagerXXX) ) instead of if( (! m_wndToolBarUiLook.Create( NULL, this, ID_VIEW_UI_LOOK_BAR ) ) {...}
I’ll get a slow start.
|
|
Jia Hong Li
|
Mar 29, 2007 - 8:44 PM
|
PS: The 2.641 still get a problem: If my app exit with maximize state, I will get the wrong location problem with maximize starting
|
|
Technical Support
|
Mar 30, 2007 - 12:07 PM
|
To find out what’s wrong, would you send us a test project (e.g. you could modify one of our samples) that demonstrates the problem?
|
|
Jia Hong Li
|
Mar 26, 2007 - 9:13 AM
|
Techsupport found this bug ?
|
|
Jia Hong Li
|
Mar 25, 2007 - 9:12 PM
|
Images updated, but problem still happen
Problem is due to the following code snippet: //////////////////////////////////[ MainFrm.cpp ]////////////////////////////////////// ... int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) ... if( !CExtControlBar::ProfileBarStateLoad( this, pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName, &m_dataFrameWP ) ) ... //////////////////////////////////////////////////////////////////////////////////////////
Before I comment it: http://picasaweb.google.com/ooy.yoo/Others/photo#5046063599617811666
After I comment it: http://picasaweb.google.com/ooy.yoo/Others/photo#5046063771416503538 The maximize function seem to calculate out the wrong location
|
|
Technical Support
|
Mar 26, 2007 - 12:11 PM
|
It seems that the problem with an incorrect window placement relates to some code in your application but there is not enough information to find out what’s wrong. Could you help us to re-produce this problem with our samples? Could you compare the code for loading/saving the state in your project and in our SDI sample application?
|
|
Suhai Gyorgy
|
Mar 23, 2007 - 5:34 AM
|
This is most probably related to usage of m_dataFrameWP. It is used to preserve window location and size between application-runs. For proper working, you should override MainFrame’s ActivateFrame method: void CMainFrame::ActivateFrame(int nCmdShow)
{
if( m_dataFrameWP.showCmd != SW_HIDE )
{
SetWindowPlacement( &m_dataFrameWP );
CFrameWnd::ActivateFrame( m_dataFrameWP.showCmd );
m_dataFrameWP.showCmd = SW_HIDE;
return;
}
CFrameWnd::ActivateFrame( nCmdShow );
}
Take care to use the proper base class, should it be different from CFrameWnd. Then in your application-class, in InitInstance, you should call this ActivateFrame method instead of ShowWindow, UpdateWindow pMainFrame->ActivateFrame( m_nCmdShow );
// pMainFrame->ShowWindow(m_nCmdShow);
// pMainFrame->UpdateWindow();
And make sure you properly initialize m_dataFrameWP in MainFrame’s constructor. ::memset( &m_dataFrameWP, 0, sizeof(WINDOWPLACEMENT) );
m_dataFrameWP.showCmd = SW_HIDE;
Both ProfileBarStateLoad in OnCreate and ProfileBarStateSave in DestroyWindow have to have &m_dataFrameWP as fifth parameter. It should work fine if all this is done and no other code messes with m_dataFrameWP or mainframe’s window position.
|
|
Jia Hong Li
|
Mar 23, 2007 - 10:53 AM
|
Hi Suhai Gyorgy, thank for ur help first.
I use ur code in my project, but problem happens yet.
PS: When I try something about ToolBar n MenuBar Docking style in ProfStudio sample, I got the same problem. All I do is to change the ToolBar n MenuBar behavior in ProfileBarStateSave block, because I am testing the DockControlBarLTRB function, Suhai Gyorgy you know
|
|
Offer Har
|
Mar 23, 2007 - 10:29 AM
|
Hi,
This happens to me as well, and i don’t even use m_dataFrameWP ... It happened after I added CExtMenuControlBar to my existing application. If I create the CExtMenuControlBar I get this weird position of my main frame when it is maximized. If you do not call Create, everything looks fine.
Thanks, Ron.
|
|