CoInitialize(NULL); 这句到底有什么作用,该如何解决
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 才会需要使用的
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 才会需要使用的