Loads a specific DLL into the caller's process. The CoGetClassObject function calls CoLoadLibrary internally; applications should not call it directly.
HINSTANCE CoLoadLibrary(
LPOLESTR lpszLibName,
//Pointer to the name of the library to be loaded
BOOL bAutoFree //Whether library is automatically freed
);
The CoLoadLibrary function is called internally by the CoGetClassObject function when the class context (CLSCTX) indicates a DLL. CoLoadLibrary loads a DLL specified by the lpszLibName parameter into the process that called CoGetClassObject. Containers should not call CoLoadLibrary directly.
Internally, a reference count is kept on the loaded DLL, by using CoLoadLibrary to increment the count and the CoFreeLibrary function to decrement it.
Windows CE: Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application. For more information about handling exceptions, see Programming Considerations.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Use version 2.0 or later.
Header: Declared in objbase.h.
Import Library: Included as a resource in ole32.dll.
CoFreeAllLibraries, CoFreeLibrary, CoFreeUnusedLibraries, CoGetClassObject