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.
A version of this page is also available for
4/8/2010

This function closes the OLE Component Object Model (COM) library, freeing any resources that it maintains.

Syntax

void CoUninitialize(); 

Parameters

None.

Return Value

None.

Remarks

A thread must call CoUninitializeonce for each successful call it has made to CoInitializeEx. Only the CoUninitializecall corresponding to the CoInitializeExcall that initialized the library can close it.

CoUninitializeshould be called on application shutdown, as the last call made to the COM library after the application hides its main windows and falls through its main message loop. If there are open conversations remaining, CoUninitializestarts a modal message loop and dispatches any pending messages from the containers or server for this COM application. By dispatching the messages, CoUninitializeensures that the application does not quit before receiving all of its pending messages. Non-COM messages are discarded.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Requirements

Header objbase.h
Library ole32.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

CoInitializeEx