The information in this article applies to:
SUMMARY
The AFX_MANAGE_STATE macro is used to establish the correct module context
for OLE controls and should be used for all external entry points to the
control. MORE INFORMATION
OLE controls written with the OLE CDK use a shared MFC DLL to eliminate the
need to have a separate copy of MFC in each control. In a way, an OLE
control is similar to a standard MFC extension DLL. Previous versions of
MFC use the _AFXDLL model to implement extension DLLs, one limitation of
this model is that the host executable had to be written to also use the
shared MFC DLL, that is it must be used by an MFC application. A different
mechanism is needed for OLE controls because they can be used by non-MFC
applications.
All OLE controls implement a self-registration feature by exporting two
functions, DllRegisterServer and DllUnregisterServer. These functions are
called directly from outside of the control, so AFX_MANAGE_STATE must be
invoked at the beginning of each function.AFX_MANAGE_STATE should also be used when handling messages sent to a child window created by an OLE control. Such messages are sent directly to the child window, bypassing the call to AFX_MANAGE_STATE in COleControl::WindowProc(). Additional query words: CDKiss kbOLE
Keywords : kbcode |
Last Reviewed: August 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |