The information in this article applies to:
SYMPTOMSIf the OLE .DLL files are not initialized with a call to AfxOleInit(), subsequent OLE calls will fail. For 32-bit MFC applications, debug output sent to a debugging window may show these errors:
- or - For 16-bit MFC applications, debug output may show:
- or -
RESOLUTIONAfxOleInit() calls OleInitialize(LPMALLOC), which sets the task memory allocator used by OLE. If this is not done, OLE cannot perform memory allocations and any OLE calls will fail. Placing a call to AfxOleInit() in the InitInstance() of an MFC application will fix this problem. The first few lines from the InitInstance() of HIERSVR (MFC OLE sample provided with Visual C++) below, shows the proper syntax for calling AfxOleInit(). Sample Code
STATUSThis behavior is by design.
Keywords : kbole kbMFC kbVC150 kbVC151 kbVC152 kbVC200 kbVC210 kbVC400 kbVC500 kbVC600 |
Last Reviewed: August 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |