#include <ole.h> |
OLESTATUS OleSetBounds(lpObject, lprcBound) | |||||
LPOLEOBJECT lpObject; | /* address of object | */ | |||
RECT FAR* lprcBound; | /* address of structure for bounding rectangle | */ |
The OleSetBounds function sets the coordinates of the bounding rectangle for the specified object on the target device.
lpObject
Points to the object for which the bounding rectangle is set.
lprcBound
Points to a RECT structure containing the coordinates of the bounding rectangle. The coordinates are specified in MM_HIMETRIC units. Neither the width nor height of an object should exceed 32,767 MM_HIMETRIC units.
The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which may be one of the following:
OLE_BUSY
OLE_ERROR_MEMORY
OLE_ERROR_OBJECT
OLE_WAIT_FOR_RELEASE
The OleSetBounds function returns OLE_ERROR_OBJECT when it is called for a linked object.
The OleSetBounds function is ignored for linked objects, because the size of a linked object is determined by the source document for the link.
A client application uses OleSetBounds to change the bounding rectangle. The client does not need to call OleSetBounds every time a server is opened.
The bounding rectangle specified in the OleSetBounds function does not necessarily have the same dimensions as the rectangle specified in the call to the OleDraw function. These dimensions may be different because of the view scaling used by the container application. An application can use OleSetBounds to cause the server to reformat the picture to fit the rectangle more closely.
In the MM_HIMETRIC mapping mode, the positive y-direction is up.