Initial Steps required for Making the DLL as COM DLL(no GUI based).



  • Hi,

    I've no previous experience with Microsoft COM component and its usage (Not even windowsOS based development ). At present I've a requirement of making my dll as COM component(the dll is not for a GUI, its a Qt class without any GUI content.) . I've read some wiki materials(Qt forums) but couldn't associate with the Qt based COM development.

    Those who have made any similare development based on COM, their input on this would be a great help.

    Thanks,



  • To achieve this, you must use "QAxServer module":http://doc.qt.nokia.com/4.7/qaxserver.html which is part of the "Active Qt Framework":http://doc.qt.nokia.com/4.7/activeqt.html#activeqt-framework

    There are also many "examples on ActiveQt":http://doc.qt.nokia.com/4.7/examples-activeqt.html
    The "COM App Example":http://doc.qt.nokia.com/4.7/activeqt-comapp.html has several simple COM objects

    Otherwise just look, how the UI objects are done, simple objects should be the same or even simpler...



  • Hi,

    Tanx for your reply. I was trying out the samples and atlast did something which resulted in COM, I guess. But, i had done something like commenting Q_OBJECT without which i'm getting some error like

    "

    GeneratedFiles\Debug\moc_classA.cpp(42): error C2039: 'staticMetaObject' : is not a member of 'scanner' ".

    The "scanner" class which is an 3rd party header file, which is an abstract class for which i've to implement some function from it.

    Interface of ClassA looks are shown below,
    @
    class CLASSA_EXPORT ClassA : public QAxBindable, public scanner {

    Q_OBJECT
    .....
    };
    @
    moc_classA.cpp, adds automatically something like shown below,

    @
    const QMetaObject ClassA::staticMetaObject = {
    { &scanner::staticMetaObject, qt_meta_stringdata_ClassA,
    qt_meta_data_ClassA, 0 }
    };
    @
    I don't know how to remove "staticMetaObject" , so commented the Q_OBJECT required.



  • Hi,

    I've removed that error by putting the QWidget class as lafirst tem in the derived class list.

    @
    class CLASSA_EXPORT ClassA : public QWidget, public QAxBindable, public scanner { Q_OBJECT ..... };
    @

    Thanks,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.