CoLoadLibrary
Loads a
specific DLL into the caller s process. The CoGetClassObject
HINSTANCE CoLoadLibrary(
LPOLESTR lpszLibName, |
//Pointer to the name of the library to be loaded |
BOOL bAutoFree |
//Whether library is automatically freed |
); |
|
Parameters
lpszLibName
[in] Pointer
to the name of the library to be loaded. The use of this name is the same as in
the Win32 function LoadLibrary.
bAutoFree
[in] If TRUE,
indicates that this library is freed when it is no longer needed, through a
call to either the CoFreeUnusedLibraries
Return Values
Module
Handle
Handle of the
loaded library.
NULL
Library could
not be loaded.
Remarks
The CoLoadLibrary
function is called internally by the CoGetClassObject function when the
class context (CLSCTX
Internally, a
reference count is kept on the loaded DLL, by using CoLoadLibrary to
increment the count and the CoFreeLibrary function to decrement it.
See Also