Search

EnableLoadWindowPlacement(false) does not work correctly in MFC feature pack by Marc_75

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 641665
Opened: 2/7/2011 12:24:15 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
When using EnableLoadWindowPlacement(false) to prevent MFC from restoring the last known main window size and position CMDIFrameWndEx::PreCreateWindow() still reads back the last known window size and position by means of m_Impl.RestorePosition(cs)

BOOL CMDIFrameWndEx::PreCreateWindow(CREATESTRUCT& cs)
{
    m_Impl.SetDockingManager(&m_dockManager);
    m_Impl.RestorePosition(cs);
    return CMDIFrameWnd::PreCreateWindow(cs);
}

workaround:
restore the attributes to the original value CW_USEDEFAULT:
cs.cx = CW_USEDEFAULT;
cs.cy = CW_USEDEFAULT;
cs.x = CW_USEDEFAULT;
cs.y = CW_USEDEFAULT;
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Reliability

Steps to reproduce

place a call of EnableLoadWindowPlacement(false) in CMyWinAppEx::InitInstance().

Product Language

English

Operating System

Windows Vista

Operating System Language

English

Actual results

MFC reads back the last known main window size and position and restores the main window to these attributes.

Expected results

no modification of the CREATESTRUCT parameters when EnableLoadWindowPlacement(false) was called.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/8/2011 at 9:57 AM
Hello,

Thanks for the report. This issue has been fixed in MFC for the next major release of Visual Studio.

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 2/7/2011 at 12:49 AM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.