The information in this article applies to:
SUMMARYWhen an OLE container embeds an in-place active capable server, the deactivation/reactivation process may be considered too long. One way to optimize the process is to hide the server rather than deactivate it. Simply hiding the server will enable a faster reactivation should the embedded object be reactivated. MORE INFORMATION
Optimizing the deactivation/reactivation process for an object embedded in
an MFC container application involves overriding the virtual
COleClientItem::OnDeactivateUI and COleClientItem::OnActivate methods.
To optimize the deactivation/reactivation process, modify the AppWizard
generated version of this function to have it invoke the embedded item's
OLEIVERB_HIDE verb to have the item hide itself:
The second step in optimizing the deactivation/reactivation process
involves modifying the virtual COleClientItem::OnActivate method to
correctly handle activation of another embedded object. To override
COleClientItem::OnActivate, first add the following public method
declaration to the declaration of the MFC container application's
COleClientItem derived class:
Add the following definition of the OnActivate method to the
implementation file for the container's COleClientItem derived class:
If the container has previously hidden an embedded object, this function
will close it prior to activating the new item. Note that this optimization
is similar to the technique that Microsoft Excel and the rich edit control
use in similar circumstances.Beginning with Visual C++ version 4.0, AppWizard-generated OLE containers contain the optimized versions of COleClientItem::OnDeactivateUI and COleClientItem::OnActivate automatically. There is no need to manually add the changes shown above. Additional query words: Word embedded UIActive
Keywords : kbole kbMFC kbVC |
Last Reviewed: July 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |