The information in this article applies to:
SYMPTOMSPreCreateWindow() for a CFormView derived class does not get called by the MFC framework during the creation process of a formview. CAUSEThis is by design. During the creation of the view, the view's Create() function is called by the framework. This then calls CWnd::Create for all the views except CFormView. The CFormView class has its own Create, which calls ::CreateDialog to create the view. CWnd::Create has a call to PreCreateWindow while CFormView::Create does not. As a result, PreCreateWindow( ) for a CFormView derived class does not get called. WORKAROUNDTo change the initial size and location, override the frame window's PreCreateWindow(). To make other changes, override the virtual function, CFormView::Create(). STATUSThis behavior is by design. MORE INFORMATION
PreCreateWindow() is generally used to alter the default values of the
CREATESTRUCT structure before the window is created. This structure
contains fields that determine the initial size, location, style, and class
among other properties for the window. For CView derived objects, the size,
location, and some of the style bits have no effect when modified. In
general, the encapsulating frame window's PreCreateWindow() should be
overridden and used instead. However, if you need to change the view's
CREATESTRUCT, you can override PreCreateWindow() for the view, except for
the CFormView (and CRecordView) class. REFERENCESFor more information, please see the MFC source library and Online Books. Additional query words: 1.00 1.50 2.00 2.10
Keywords : kbnokeyword kbMFC kbVC |
Last Reviewed: July 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |