Microsoft Windows CE 3.0  

CoLoadLibrary

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function is called internally by the CoGetClassObject, when the class context indicates a DLL, to load a specific DLL into the caller's process. Applications should not call it directly.

HINSTANCE CoLoadLibrary(
LPOLESTR
lpszLibName
,
BOOL
bAutoFree
);

Parameters

lpszLibName
[in] Long pointer to the null-terminated string that contains the name of the library to be loaded. The use of this name is the same as in the Win32 function LoadLibrary.
bAutoFree
[in] Ignored; explicitly unload with the CoFreeLibraryfunction.

Return Values

The handle of the loaded library indicates success. NULL indicates that the library could not be loaded.

Remarks

The CoLoadLibraryfunction is called internally by the CoGetClassObjectfunction when the class context ( CLSCTX) indicates a DLL. CoLoadLibraryloads a DLL specified by the lpszLibNameparameter into the process that called CoGetClassObject. Containers should not call CoLoadLibrarydirectly.

Internally, a reference count is kept on the loaded DLL, by using CoLoadLibraryto increment the count and the CoFreeLibraryfunction to decrement it.

Passing into this function any invalid and, under some circumstances, NULL pointers result in unexpected termination of the application.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later Objbase.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CoFreeLibrary, CoGetClassObject, LoadLibrary