CoUninitialize

王朝百科·作者佚名  2012-03-11  
宽屏版  字体: |||超大  

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 callCoUninitializeonce for each successful call it has made toCoInitializeorCoInitializeEx. Only theCoUninitializecall corresponding to theCoInitializeorCoInitializeExcall that initialized the library can close it.

Calls to OleInitialize must be balanced by calls to OleUninitialize. TheOleUninitializefunction callsCoUninitializeinternally, so applications that callOleUninitializedo not also need to callCoUninitialize.

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.

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

RequirementsWindows 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:使用图书馆。

 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝百科 版权所有