[英]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.