OleDraw function
Enables drawing objects more easily. You can use it instead of calling IViewObject::Draw directly.
Syntax
HRESULT OleDraw( _In_ LPUNKNOWN pUnknown, _In_ DWORD dwAspect, _In_ HDC hdcDraw, _In_ LPCRECT lprcBounds );
Parameters
- pUnknown [in]
-
Pointer to the IUnknown interface on the view object that is to be drawn.
- dwAspect [in]
-
How the object is to be represented. Representations include content, an icon, a thumbnail, or a printed document. Possible values are taken from the DVASPECT enumeration.
- hdcDraw [in]
-
Device context on which to draw. Cannot be a metafile device context.
- lprcBounds [in]
-
Pointer to a RECT structure specifying the rectangle in which the object should be drawn. This parameter is converted to a RECTL structure and passed to IViewObject::Draw.
Return value
This function returns S_OK on success. Other possible values include the following.
| Return code | Description |
|---|---|
|
No data to draw from. |
|
The draw operation was aborted. |
|
No data to draw from. |
|
The rectangle is invalid. |
|
One or more parameters are invalid. |
|
Insufficient memory for the operation. |
|
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] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also