The information in this article applies to:
SYMPTOMS
Some of the Advance Options in Step 4 of AppWizard have no effect on an
AppWizard-generated SDI applications. The Maximized and Minimized options
for the Main Frame Window in the Window Styles tab have no effect when
selected for an SDI application. CAUSEThe AppWizard-generated code does not have code to show the main window maximized or minimized. MFC code shows the main window with value passed into the program through the nCmdShow argument to WinMain. This value is normally SW_NORMAL and hence the window will not be maximized or minimized. RESOLUTION
MFC stores the value passed through the nCmdShow argument to WinMain in
CWinApp::m_nCmdShow. This variable can be modified to get the behavior you
want. To have an SDI application initially maximized or minimized, set
this variable to the appropriate value. Set m_nCmdShow to SW_SHOWMAXIMIZED
to maximize or SW_SHOWMINIMIZED to minimize the main frame window
initially. This variable has to be modified in the InitInstance() function
of the CWinApp-derived class before the main window is made visible.
If the application was generated with an earlier version of Visual C++,
set m_nCmdShow to the appropriate value before this line:
In the Visual C++ 4.2 AppWizard-generated application do the following:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. The problem was corrected in Visual C++ version 5.0. MORE INFORMATIONThe following sample code shows the correct context in which m_nCmdShow has to be modified and demonstrates how to show an sdi application initially maximized. Sample Code
Additional query words: kbVC400bug
Keywords : kbnokeyword kbwizard kbMFC kbVC kbVC500fix |
Last Reviewed: September 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |