Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic


For OLE support from a regular DLL that is dynamically linked to MFC, call this function in your regular DLL's CWinApp::InitInstance function to initialize the MFC OLE DLL.

void AFXAPI AfxOleInitModule( );

The MFC OLE DLL is an extension DLL; in order for an extension DLL to get wired into a CDynLinkLibrary chain, it must create a CDynLinkLibrary object in the context of every module that will be using it. AfxOleInitModule creates the CDynLinkLibrary object in your regular DLL's context so that it gets wired into the CDynLinkLibrary object chain of the regular DLL.

If you are building an OLE control and are using COleControlModule, you should not call AfxOleInitModule because the InitInstance member function for COleControlModule calls AfxOleInitModule.

Header: <afxdll_.h>

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.