Serious BUG in MFC Undermines Application Developer Control over the application - by charles_cotton

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 631723 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/15/2010 6:43:04 PM
Access Restriction Public


At Line 2406 in WinFrm.cpp, ShowWindow is called.  This occurs during the 'ProcessShellCommand(cmdInfo)' call within the InitInstance function which is part of the CWinApp derived class created by the MFC AppWizard.

Could you make the otherwise very simple tasks of creating instances of the document, frame and view objects any more complicated and obtuse? Oh, that's right; you Redmondians think obfuscation is a good thing ...  It's not!

This errant ShowWindow call occurs before the correctly placed and timed ShowWindow call within the InitInstance member function itself which is immediately after the ProcessShellCommand call.  It looks like this errant ShowWindow call can be avoided with a flag, but this is the behavior of an MFC application, 'out of the box.'

What's going on over their in MFC land at Microsoft?

We application developers would like to be the ones to call ShowWindow.  We don't want you MFC guys calling it for us deep within your MFC code.

I know it does this 'by design.'  It's a defective design!

Thank you so much for looking into this !

Sign in to post a comment.
Posted by charles_cotton on 1/27/2011 at 11:07 AM
Thanks, Pat, that's great news!

Posted by Microsoft on 1/26/2011 at 4:44 PM
Hello Charles,

Thanks for the report. The issue you are referring to (amongst the vitriol) has been fixed in MFC for the next major release of Visual Studio. You will be able to set a flag to control the ShowWindow that is happening inside of CWinAppEx::ReloadWindowPlacement (this is the actual problem, not the instance in winfrm.cpp).

Pat Brenner
Visual C++ Libraries Development
Posted by Helen [MSFT] on 12/16/2010 at 1:11 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 12/15/2010 at 8:36 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(