# IOleControlSite::TransformCoords

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.

HRESULT TransformCoords(

POINTL* pptlHimetric , | //Indirect pointer to structure
POINTF* pptfContainer , | //Indirect pointer to structure
DWORD dwFlags | //Flags indicating the exact conversion
); |

Parameters

pptlHimetric
  [in, out] Indirect pointer to 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] Indirect pointer to 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 Values

This method supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following:

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_POINTER
  The address in pptlHimetric or pptfContainer is not valid. For example, it may be NULL.

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.

See Also

POINTF