CoFreeLibrary

Frees a library that, when loaded, was specified to be freed explicitly.

void CoFreeLibrary(
  HINSTANCE hInst  //Handle of the library module to be freed
);
 

Parameter

hInst
[in] Handle to the library module to be freed, as returned by CoLoadLibrary.

Remarks

The CoFreeLibrary function should be called to free a library that is to be freed explicitly. This is established when the library is loaded with the bAutoFree parameter of CoLoadLibrary set to FALSE. It is illegal to free a library explicitly when the corresponding CoLoadLibrary call specifies that it be freed automatically (the bAutoFree parameter is set to TRUE).

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.

QuickInfo

  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.

See Also

CoFreeAllLibraries, CoFreeUnusedLibraries, CoLoadLibrary