Trouble accessing .NET .dll via QtService application (COM)

  • Hi guys,

    I'm having issues communicating with a .NET .dll I've constructed from a Qt Plugin .dll I've also made. Basically I just want some function in my Qt Plugin .dll to call a function in my .NET .dll. At the moment, I'm able to effectively communicate with my .NET .dll from a regular Qt application, but the same stuff doesn't work in my Qt Plugin .dll.

    Here is the code for my Qt tester application I used to make sure I could communicate with my .NET .dll:

    QT += core gui
    QT += network

    TARGET = DllTest
    TEMPLATE = app
    SOURCES += main.cpp
    HEADERS += dllwidget.h
    FORMS += dllwidget.ui
    CONFIG += qaxcontainer

    Relevant code from dllwidget.cpp:

    QString tstr;
    QAxObject* obj = new QAxObject("IntegrationManagerManager.InterfaceImplementation");
    tstr = obj->dynamicCall("SomeFunction(string code, string password)",
    "username", "pass").toString();

    ...basically just me calling a particular function from my .NET .dll, which returns a string to me. This works just fine and gives me the data I need.

    Now, code from the Qt Plugin .dll that is not working:

    TEMPLATE = lib
    CONFIG += plugin
    CONFIG += qaxcontainer
    INCLUDEPATH += ../firstapp
    TARGET = $$qtLibraryTarget(myplugin)

    SOURCES +=

    HEADERS +=

    The relevant code from someplugin.cpp is exactly the same as the previous code from dllwidget.cpp. I'm just trying to get this Qt Plugin .dll to be able to make the same COM calls as my test Qt application. I'm not sure why it works in the application and not in the library.

    EDIT: I wanted to point out that there are no compilation errors, but I am unable to retrieve any information when performing the function through the Qt Plugin .dll. I'm outputting text files with the returned data to tell if it worked, as the Qt application accessing the Qt Plugin is built as a Windows Service application using the QtService framework.

    If I left out any important information, please let me know.

    Thanks very much,

    EDIT2: Turns out I can't access my .NET .dll via COM even from the QtService application, cutting out the Qt Plugin .dll middleman.

  • Going a different way with this: rather than using a QtService, I'm using a traditional Qt application where the issue doesn't occur, at least for the time being.

Log in to reply

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