The information in this article applies to:
SUMMARY
Some server applications want to have their presentation displayed
differently based on the size of the object in the container application.
For example, if version 6.0 of Microsoft Word For Windows is used as a
server application, Word for Windows will rewrap the text of an object
based on the object size in the container. This is accomplished in a server
application by setting the OLEMISC_RECOMPOSEONRESIZE bit in the MiscStatus
bits. MORE INFORMATION
To properly honor the OLEMISC_RECOMPOSEONRESIZE bit, the container needs to
check the MiscStatus bits by calling IOleObject::GetMiscStatus(). Once the
status bits are retrieved, the container can then check to see if the
OLEMISC_RECOMPOSEONRESIZE bit is set. If the bit is set, then the server
wishes to be notified every time the object size changes in the container.
To inform the server application the object has been resized, the container
needs to call IOleObject::SetExtent() to set the new size of the object.
However, IOleObject::SetExtent() only works while the object is in the
running state. The container application should check if the object is
already in a running state by calling the OleIsRunning() function. This is
important because the container needs to restore the state of the object
once the operation is complete. If the object was not in the running state,
OleRun() needs to be called such that the IOleObject::SetExtent() call
takes effect. At this point the IOleObject::SetExtent() method call can be
made, and should be followed with a call to IOleObject::Update() to update
the presentation of the object in the container. Finally, if this section
of code ran the server, then it needs to transition the server back to the
loaded state by calling IOleObject::Close().
Additional query words: 2.00 2.01 3.50 4.00
Keywords : kbole kbprg kbNTOS350 kbNTOS351 kbOLE200 kbWinOS95 kbDSupport |
Last Reviewed: October 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |