The information in this article applies to:
SYMPTOMSCalling SetScaleToFitSize in OnInitialUpdate of a CFormView derived class causes the following assertion to fail:
CAUSEBecause the view window has not yet been displayed, SetScaleToFitSize() uses the size of the CFormView. Because the CFormView is created with size CRect(0,0,0,0), the view size is miscalculated. RESOLUTIONTo set the view window size before calling SetScaleToFitSize, call RecalcLayout on the parent frame. For example:
See the sample code below for an example of this.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft Foundation Classes (MFC) version 2.0. This problem was corrected in the Microsoft Foundation Classes version 2.5. MORE INFORMATIONThe call to RecalcLayout in OnInitialUpdate is no longer needed with MFC version 2.5 because the framework takes care of calling RecalcLayout in response to the WM_CREATE message before the call to OnInitialUpdate is made. Sample Code
Additional query words: 1.00 2.00 2.10
Keywords : kbDocView kbMFC kbVC |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |