Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Active Qt: How To Implement ISomething COM Interface



  • Apologies if I'm missing something obvious, but after many hours searching and experimenting, I cannot figure out how to use Active Qt to implement a published COM interface. I have a type library and dumpcpp allows me to create a Qt wrapper to consume an object implemented externally, but I can't figure out how to create a Qt object that implements the COM interface.

    I can see how Active Qt makes it easy to implement IDispatch with a QObject or QWidget. But I don't need IDispatch.

    The opengl example shows how to extend a QObject with a published interface via QAxAggregated, but this seems unnecessary.

    I must be missing something.



  • To provide more background, we want to implement an Excel COM add-in by implementing Microsoft's _IDTExtensibility2 COM interface. Perhaps I am confused, but I assumed I needed to create a COM object that implements that interface - that "is a" _IDTExtensibility2 object. Is this wrong? I am obviously missing something here.



  • Hi, you can implement the _IDTExtensibility2 COM interface using the QAxServer class (in-process server). But the _IDTExtensibility2 interface is so much last century technology :-(

    Instead, consider trying the Javascript flavored addins to Excel (they also work on Excel for Macs or iPads)



  • @hskoglund - I will investigate the Javascript approach. Thanks.

    I would still be interested in how to implement a published interface using Active Qt. I believe QAxServer is a module, not a class.


Log in to reply