c++ - 初始化 COM C++ 服务多线程的正确方法

标签 c++ winapi com windows-services

在 CoInitializeEx 调用中使用带有 COINIT_MULTITHREADED 标志的 COINIT_DISABLE_OLE1DDE 有任何影响:

CoInitializeEx(0, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE ); 

最佳答案

这里有一段话 from MSDN :

In addition to the flags already mentioned, it is a good idea to set the COINIT_DISABLE_OLE1DDE flag in the dwCoInit parameter. Setting this flag avoids some overhead associated with Object Linking and Embedding (OLE) 1.0, an obsolete technology.

关于c++ - 初始化 COM C++ 服务多线程的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20404500/

相关文章:

windows -::PostMessage 到一个无效的 hWnd

string - 如何测试 CComBSTR 是否为空

c++ - 如何在不抽取 WM_PAINT 的情况下在 STA 中抽取 COM 消息?

c++ - 在一行中将 int 写入 std::ofstream::write()

c++ - Qt鼠标点击检测一直不工作

C++ 奇怪的 "undefined reference"

java - 线程中的异常 "main"com4j.ExecutionException : com4j. ComException : 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp

c++ - 在 C++ 中创建自定义 C 类型字符串类

c++ - CreateFileA 间歇性返回错误 20、 "The system cannot find the device specified"

python - 在 Python 应用程序 (Windows) 中创建小型转储