读书人

CoInitialize(NULL); 这句到底有什么作

发布时间: 2012-04-20 15:27:03 作者: rapoo

CoInitialize(NULL); 这句到底有什么作用
CoInitialize(NULL);
在什么情况下要用这句话呢,
能说的详细点吗,谢谢了

[解决办法]
Initializes the COM library on the current apartment and identifies the concurrency model as single-thread apartment (STA). Applications must initialize the COM library before they can call COM library functions other than CoGetMalloc and memory allocation functions.

初始化com库。应用程序调用com库函数(除CoGetMalloc和内存分配函数)之前必须初始化com库
New applications should call CoInitializeEx instead of CoInitialize.
新的应用程序应该调用CoInitializeEx而不是CoInitialize


[解决办法]
一般是在 Dll 中使用 COM 才会需要使用的

读书人网 >C++ Builder

热点推荐