DOC: GetClientRect() May Assert in OLE ControlsLast reviewed: July 31, 1997Article ID: Q138664 |
The information in this article applies to:
SUMMARYIn chapter 4 of the Ole Control Tutorial, the section labeled Setting the CircleOffset Property Step 2, which describes how to implement the InBounds() function, incorrectly calls GetClientRect() and should read as follows instead:
MORE INFORMATIONIn some control containers (such as Visual Basic and Microsoft Access) in design mode, the control has no window, and therefore no hwnd, so calling GetClientRect(rc) will assert. There are actually two solutions to this problem. The first solution is documented in the "Summary" section of this article. The second solution is to replace the call to GetClientRect() with a call to GetRectInContainer(), which will obtain the coordinates of the control's rectangle relative to the container. The size of the control can then be calculated from this rectangle. Technology : kbMfc kbole Version : 1.0 1.1 1.2 4.0 4.1 4.2 Issue type : kbdocerr Solution Type : kbdocfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |