PRB: Object Appears Larger During Visual Editing

Last reviewed: May 17, 1995
Article ID: Q104791
The information in this article applies to:
  • Microsoft OLE Libraries for Windows and Win32s, version 2.0
  • Microsoft OLE Libraries, included with:

        - Microsoft Windows NT, versions 3.5 and 3.51
        - Microsoft Windows 95
    

SYMPTOMS

An OLE 2.0 object appears larger during visual editing compared to the loaded state.

CAUSE

The Windows application programming interface (API) LPtoDP is being used to convert the size of the object from MM_HIMETRIC to MM_TEXT. The object is then drawn with the MM_TEXT coordinates as the bounding rectangle.

RESOLUTION

LPtoDP is dependent on the current mapping mode to perform a conversion from logical points to device points. For a more accurate transformation, a function must be written to "manually" convert the units from MM_HIMETRIC to MM_TEXT by using GetDeviceCaps to get the logical pixels per inch for use in the conversion. The OLE2UI library, included with the OLE 2.0 toolkit, already includes several transformation functions to properly convert the units:

   XformWidthInPixelsToHimetric  - Converts an int width into HiMetric
units
   XformWidthInHimetricToPixels  - Converts an int width from HiMetric
units
   XformHeightInPixelsToHimetric - Converts an int height into HiMetric
                                   units
   XformHeightInHimetricToPixels - Converts an int height from HiMetric
                                   units
   XformRectInPixelsToHimetric   - Converts a rect into HiMetric units
   XformRectInHimetricToPixels   - Converts a rect from HiMetric units
   XformSizeInPixelsToHimetric   - Converts a SIZEL into HiMetric units
   XformSizeInHimetricToPixels   - Converts a SIZEL from HiMetric units

For more information on these functions, consult the "User Interface Dialog Help" help file (OLE2UI.HLP) included with the OLE 2.0 toolkit.


Additional reference words: 2.00 3.50 4.00
KBCategory: kbole kbprg kbprb
KBSubcategory: LeTwoPrs


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.