Compartir a través de


IOleControlSite::TransformCoords

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Converts between a POINTL structure expressed in HIMETRIC units (as is standard in OLE) and a POINTF structure expressed in units specified by the container. By converting the methods, the control can ensure that it sends coordinate information to the container in units that are directly usable in the container without additional conversion.

Syntax

HRESULT TransformCoords( 
  POINTL* pPtlHimetric , 
  POINTF* pPtfContainer , 
  DWORD dwFlags 
);

Parameters

  • pPtlHimetric
    [in, out] Address of a POINTL structure containing coordinates expressed in HIMETRIC units. This is an [in] parameter when dwFlags contains XFORMCOORDS_HIMETRICTOCONTAINER; it is [out] with XFORMCOORDS_CONTAINERTOHIMETRIC. In the latter case, the contents are undefined on error.
  • pPtfContainer
    [in, out] Address of a caller-allocated POINTF structure that receives the converted coordinates. This is an [in] parameter when dwFlags contains XFORMCOORDS_CONTAINERTOHIMETRIC; it is [out] with XFORMCOORDS_HIMETRICTOCONTAINER. In the latter case, the contents are undefined on error.
  • dwFlags
    [in] Flags indicating the exact conversion to perform. The dwFlags parameter can be any combination of the following values except where indicated:

    Flag Value Description

    XFORMCOORDS_POSITION

    The coordinates to convert represent a position point. Cannot be used with XFORMCOORDS_SIZE.

    XFORMCOORDS_SIZE

    The coordinates to convert represent a set of dimensions. Cannot be used with XFORMCOORDS_POSITION.

    XFORMCOORDS_HIMETRICTOCONTAINER

    The operation converts pptlHimetric into pptfContainer. Cannot be used with XFORMCOORDS_CONTAINERTOHIMETRIC.

    XFORMCOORDS_CONTAINERTOHIMETRIC

    The operation converts pptfContainer into pptlHimetric. Cannot be used with XFORMCOORDS_HIMETRICTOCONTAINER.

Return Value

This method supports the following return values:

Value Description

S_OK

The conversion was performed successfully.

E_NOTIMPL

The container does not require any special coordinate conversions. The container deals completely in HIMETRIC.

E_INVALIDARG

The call contains an invalid argument.

E_POINTER

The address in pptlHimetric or pptfContainer is not valid. For example, it may be NULL.

E_UNEXPECTED

The call to the method unexpectedly failed.

Remarks

A control uses this method when it has to send coordinates to a container within an event or some other custom call or when the control has container coordinates that it needs to convert into HIMETRIC units.

Requirements

Header ocidl.h
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

COM Interfaces