Important: Please read the Qt Code of Conduct -

QT + ActiveX / COM issue with SnelStartGateway.dll

  • Hej folks,

    I'm trying to make a QT5 (windows) Desktop application (using the msvc2013 compiler with QT Creator) that uses "SnelStartGateway.dll", which is an ActiveX dll that allows programs to interact with the SnelStart accounting software.
    I've registered the dll in windows with regsvr32 and added a line in the project file:
    TYPELIBS = $$system(dumpcpp -getfile {63A21693-4122-45B5-96B6-919C78D7EBF5})
    This generates a cpp and h file that I included.

    Now for the fun part:
    The DLL exposes a few classes, starting with a SnelStartGateway::clsGWaySnelStart class / object that I can instantiate and work with. It also includes a SnelStartGateWay::clsGWayLoginSettings object that I can instantiate and use to enter login settings.
    My problem arrives when trying to use this instance of SnelStartGateWay::clsGWayLoginSettings to call the mtdGWayAdmiOpenenViaLoginSettings method of the SnelStartGateway::clsGWaySnelStart instance. The dumpcpp generated SnelStartGateway.h claims that this method requires SnelStartGateWay::_clsGWayLoginSettings as parameter 1 (note the underscore) instead of the object I can instantiate.
    When I try to make a SnelStartGateWay::_clsGWayLoginSettings object and enter settings it fails with:
    QAxBase::qt_metacall: Object is not initialized, or initialization failed
    If I try to enter the non underscore object it won't accept it and can't typecast it with succes either.

    One way of obtaining a 'working' SnelStartGateWay::_clsGWayLoginSettings instance is through the prpGWayLoginSettingsGet() method in SnelStartGateway::clsGWaySnelStart, but this opens a dialog that needs user interaction which I really don't want.

    I've also tried to call setControl on the underscore version of the loginsettings object to set it to the control of the non underscore version ({0a4ca491-e6bf-48e8-81f7-f9233de2c8f1} which I got from the .h file), which works for entering the settings, but then the call to mtdGWayAdmiOpenenViaLoginSettings fails with:
    QAxBase: Error calling IDispatch member mtdGWayAdmiOpenenViaLoginSettings: Type mismatch in parameter 1

    Does anyone know a solution? :)

    Thanks for reading!


Log in to reply