请输入您要查询的百科知识:

 

词条 CoUninitialize
释义

CoUninitialize Closes the COM library on the current thread, unloads all DLLs loaded by the thread, frees any other resources that the thread maintains, and forces all RPC connections on the thread to close.

void CoUninitialize( );Remarks A thread must call CoUninitialize once for each successful call it has made to CoInitialize or CoInitializeEx. Only the CoUninitialize call corresponding to the CoInitialize or CoInitializeEx call that initialized the library can close it.

Calls to OleInitialize must be balanced by calls to OleUninitialize. The OleUninitialize function calls CoUninitialize internally, so applications that call OleUninitialize do not also need to call CoUninitialize.

CoUninitialize should 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, CoUninitialize starts a modal message loop and dispatches any pending messages from the containers or server for this COM application. By dispatching the messages, CoUninitialize ensures that the application does not quit before receiving all of its pending messages. Non-COM messages are discarded.

Because there is no way to control the order in which in-process servers are loaded or unloaded, it is not safe to call CoInitialize, CoInitializeEx, or CoUninitialize from the DllMain function.

Requirements Windows NT/2000: Requires Windows NT 3.1 or later.

Windows 95/98: Requires Windows 95 or later.

Header: Declared in objbase.h.

Library: Use ole32.dll.

中文详解

CoUninitialize关闭当前线程的组件对象模型 库,卸载所有dll载入的帖子,不释放任何其他的资源,并强制线程维护所有的远程过程调用线程只上的接头失效CoUninitialize();备注一个线程必须打电话给CoUninitialize一旦每次成功叫它使CoInitialize或CoInitializeEx。只有CoUninitialize对应于CoInitialize打电话叫进行初始化或CoInitializeEx图书馆能关闭它。 调用OleInitialize必须被平衡,OleUninitialize来电。 函数调用的OleUninitialize内部,所以应用CoUninitialize那叫OleUninitialize做不也需要打电话给CoUninitialize。 CoUninitialize应该呼吁应用关机,作为最后一次调用COM库的应用后隐藏其主要的窗户,掉了下去其主要消息循环。如果有剩余的,开放的对话开始了CoUninitialize模态消息循环和谕旨从容器里的任何待审消息或服务器的应用为这个COM。通过调度的信息,CoUninitialize确保应用程序不退出后才接受它的所有待审消息。Non-COM信息被丢弃。 因为没办法控制的次序,装卸过程服务器,是不安全的,CoInitializeEx打电话,或者CoUninitialize CoInitialize从DllMain功能。 要求Windows NT / 2000:需要窗口新台币3.1或以后。Windows 95 / 98:需要Windows 95或以后。 标题:在objbase.h宣布。 ole32.dll:使用图书馆。

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2024/12/23 12:40:04