简体   繁体   English

我可以在Qt应用程序中使用现有的本机Windows COM界面吗

[英]Can I use an existing native Windows COM interface in a Qt app

I'm having to use an SDK modeled on Microsoft's COM. 我必须使用基于Microsoft COM的SDK。 I'm developing for Windows in C++. 我正在为Windows开发C ++。

I found this article that implies one can "use COM in Qt", but it is not clear whether they mean to register my own, new COM interface or whether they mean I can use an existing one that wasn't created in Qt (they speak of "creating a COM server"). 我发现这篇文章暗示人们可以“在Qt中使用COM”,但是不清楚它们是否意味着注册自己的新COM接口,或者它们是否意味着我可以使用未在Qt中创建的现有接口(它们说“创建COM服务器”)。

The question is whether this is possible in Qt and whether this is somewhat of a hack or standard practice. 问题是,这在Qt中是否可行,这在某种程度上是hack还是标准做法。 If it is possible, would it make a difference if Qt is using the MinGW or VS compiler? 如果可能的话,如果Qt使用MinGW或VS编译器,会有所不同吗?

You can read in the Qt documentation about Active Qt module : 您可以在Qt文档中阅读有关Active Qt模块的信息:

Qt's ActiveX and COM support allows Qt for Windows developers to: Qt的ActiveX和COM支持使Windows开发人员可以使用Qt:

  • Access and use ActiveX controls and COM objects provided by any ActiveX server in their Qt applications. 访问和使用任何ActiveX服务器在其Qt应用程序中提供的ActiveX控件和COM对象。

  • Make their Qt applications available as COM servers, with any number of Qt objects and widgets as COM objects and ActiveX controls. 使它们的Qt应用程序可用作COM服务器,并使用任意数量的Qt对象和小部件作为COM对象和ActiveX控件。

So the answer is that you can easily use existing com objects and activex controls created with any language in your Qt application with the API provided by the Active Qt module. 因此,答案是,您可以通过Active Qt模块提供的API轻松使用Qt应用程序中以任何语言创建的现有com对象和activex控件。 You can either use VS compiler or MinGW. 您可以使用VS编译器或MinGW。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将新的Qt窗口与现有的X应用程序集成在一起? - How can I integrate new Qt windows with an existing X application? 我可以通过Windows服务访问itunes com界面吗? - can i access itunes com interface through windows services? 我可以在 ZE8801102A40AD89DDCFCFDCAEBF008D25Z Creator 中调试 com 服务器吗? - Can I debug com server in Qt Creator? 在Qt应用程序中,我可以使用什么来取代睡眠和睡眠? - what can I use to replace sleep and usleep in my Qt app? 如何使用本机C ++的COM实现C#接口? - How to implement interface of C# use COM of native C++? ActiveQt Com应用示例-COM服务器未在Windows注册表中注册(Qt4.7.4) - ActiveQt Com app example - COM server not registered in Windows registry (Qt4.7.4) Qt中是否可以使用本机“文件浏览器”让用户选择特定文件的路径? - Is there a native “file explorer” in Qt that I can use to have the user select path to a specific file? Windows 电话 7 - 使用本机 DLL - 需要 Class 和接口的 GUID - Windows Phone 7 - Use Native DLL - Need GUID of Class and Interface 如何在 Qt 中的 Android 上使用 USB OTG 串行接口? - How can one use an USB OTG serial interface on Android, in Qt? 如何在Native Visual C ++中轻松使用COM组件 - How can I easily use a COM component in Native Visual C++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM