OleDraw function

Enables drawing objects more easily. You can use it instead of calling IViewObject::Draw directly.

Syntax

OLESTATUS OleDraw(
  LPOLEOBJECT ,
  HDC         ,
  const RECT  *,
  const RECT  *,
  HDC         
);

Parameters

arg1

TBD

arg2

TBD

arg3

TBD

arg4

TBD

arg5

TBD

Return Value

This function returns S_OK on success. Other possible values include the following.

Return code Description
OLE_E_BLANK
No data to draw from.
E_ABORT
The draw operation was aborted.
VIEW_E_DRAW
No data to draw from.
OLE_E_INVALIDRECT
The rectangle is invalid.
E_INVALIDARG
One or more parameters are invalid.
E_OUTOFMEMORY
Insufficient memory for the operation.
DV_E_NOIVIEWOBJECT
The object doesn't support the IViewObject interface.

Remarks

The OleDraw helper function calls the QueryInterface method for the object specified (pUnk), asking for an IViewObject interface on that object. Then, OleDraw converts the RECT structure to a RECTL structure, and calls IViewObject::Draw as follows:

lpViewObj->Draw(dwAspect,-1,0,0,0,hdcDraw,&rectl,0,0,0);

Do not use this function to draw into a metafile because it does not specify the parameter required for drawing into metafiles.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole.h (include Ole2.h)
Library Ole32.lib
DLL Ole32.dll

See Also

IViewObject::Draw