c++ - 我可以在 Qt 应用程序中使用现有的 native Windows COM 接口(interface)吗

标签 c++ windows qt com

我必须使用以 Microsoft 的 COM 为模型的 SDK。我正在使用 C++ 为 Windows 开发。

我找到了 this article这意味着可以“在 Qt 中使用 COM”,但不清楚它们是要注册我自己的新 COM 接口(interface),还是意味着我可以使用不是在 Qt 中创建的现有接口(interface)(他们说“创建一个 COM 服务器”)。

问题是这在 Qt 中是否可行,以及这是否有点 hack 或标准做法。如果可能的话,Qt 使用 MinGW 或 VS 编译器会有什么不同吗?

最佳答案

您可以在 Qt 文档中阅读关于 Active Qt 的内容模块:

Qt's ActiveX and COM support allows Qt for Windows developers to:

  • Access and use ActiveX controls and COM objects provided by any ActiveX server in their Qt applications.

  • Make their Qt applications available as COM servers, with any number of Qt objects and widgets as COM objects and ActiveX controls.

因此,答案是您可以通过 Active Qt 模块提供的 API 在您的 Qt 应用程序中轻松使用以任何语言创建的现有 com 对象和 activex 控件。您可以使用 VS 编译器或 MinGW。

关于c++ - 我可以在 Qt 应用程序中使用现有的 native Windows COM 接口(interface)吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28851433/

相关文章:

windows - 使用参数运行exe文件的Powershell脚本

c++ - 通过 TCP 将图像从 labVIEW 发送到 QT

c++ - 如何调试段错误?

c++ - 比较字符串在 mingw 和 ubuntu gcc 上表现不同

c# - 如何使用 C# 访问 iOS App 的文档文件夹

python - 可插入的Python程序

c++ - setData() 和 insert Rows() Qt 模型 View

c++ - 指向具有指针成员的对象的指针

c++ - 在二叉搜索树 C++ 中插入字符串时出错

node.js - 在 Electron 应用程序的 Squirrel 事件中执行 createShortcut