Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. From QT-COM Create IDL from DLL.
Forum Updated to NodeBB v4.3 + New Features

From QT-COM Create IDL from DLL.

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 451 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Madhura
    wrote on last edited by Madhura
    #1

    Expeted : Need to generate IDL file for DLL Library.

    We have created a Qt Application and its output is exe, When we run idc to genrate idl from the exe it genrates properly.

    1. We have created a DLL project.
    2. Building the project it properly builds and generates the dll.
    3. If we try to generate idl from the dll using IDC, it fails and throws the error as shown below.

    Couldn't resolve 'DumpIDL' symbol in C:...\Debug\SubClass.dll
    Class has no metaobject information (error in C:...\Debug\SubClass.dll)!

    Our Dll project created from QT and converted to MSVC

    QT CMD : idc.exe "SubClass.dll" -idl "SubClass.idl" -version 1.0

    SubClass.H
    #include <atlbase.h>
    #include <atlsafe.h>
    #include <qobject.h>
    #include <qstring.h>

    using namespace std;
    class SWISubClass : public QObject, public QAxBindable
    {
    Q_OBJECT

        QAXFACTORY_DEFAULT(SWISubClass,
            "{xxxxx-xxxxx-xxxxx-xxxxx}",
            "{xxxxx-xxxxx-xxxxx-xxxxx}",
            "{xxxxx-xxxxx-xxxxx-xxxxx}",
            "{xxxxx-xxxxx-xxxxx-xxxxx}",
            "{xxxxx-xxxxx-xxxxx-xxxxx}")
    

    public:
    explicit SubClass(QObject* parent = nullptr);
    ~SubClass();

    public Q_SLOTS:
    bool OpenProject(QString projectPath);

    };

    SubClass.CPP
    #pragma once
    #include "SubClass.h"
    using namespace std;

    SubClass::SubClass(QObject *obj) : QObject(obj) {}

    SubClass::~SubClass(){}

    bool SubClass::OpenProject(QString projectPath){return true;}

    JonBJ 1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, for idc.exe to work on a .dll it needs to call a Qt function inside the .dll called DumpIDL().

      Probably you forget to define DumpIDL as a public symbol, easiest is to create (or edit an existing) .DEF file with:

      EXPORTS
          DumpIDL              PRIVATE
      
      1 Reply Last reply
      0
      • M Madhura

        Expeted : Need to generate IDL file for DLL Library.

        We have created a Qt Application and its output is exe, When we run idc to genrate idl from the exe it genrates properly.

        1. We have created a DLL project.
        2. Building the project it properly builds and generates the dll.
        3. If we try to generate idl from the dll using IDC, it fails and throws the error as shown below.

        Couldn't resolve 'DumpIDL' symbol in C:...\Debug\SubClass.dll
        Class has no metaobject information (error in C:...\Debug\SubClass.dll)!

        Our Dll project created from QT and converted to MSVC

        QT CMD : idc.exe "SubClass.dll" -idl "SubClass.idl" -version 1.0

        SubClass.H
        #include <atlbase.h>
        #include <atlsafe.h>
        #include <qobject.h>
        #include <qstring.h>

        using namespace std;
        class SWISubClass : public QObject, public QAxBindable
        {
        Q_OBJECT

            QAXFACTORY_DEFAULT(SWISubClass,
                "{xxxxx-xxxxx-xxxxx-xxxxx}",
                "{xxxxx-xxxxx-xxxxx-xxxxx}",
                "{xxxxx-xxxxx-xxxxx-xxxxx}",
                "{xxxxx-xxxxx-xxxxx-xxxxx}",
                "{xxxxx-xxxxx-xxxxx-xxxxx}")
        

        public:
        explicit SubClass(QObject* parent = nullptr);
        ~SubClass();

        public Q_SLOTS:
        bool OpenProject(QString projectPath);

        };

        SubClass.CPP
        #pragma once
        #include "SubClass.h"
        using namespace std;

        SubClass::SubClass(QObject *obj) : QObject(obj) {}

        SubClass::~SubClass(){}

        bool SubClass::OpenProject(QString projectPath){return true;}

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @Madhura
        Hello and welcome.

        I suggest you post questions about code in the General and Desktop forum, not the Jobs forum, which is for advertising/requesting jobs.

        jsulmJ M 2 Replies Last reply
        1
        • jsulmJ jsulm moved this topic from Jobs on
        • JonBJ JonB

          @Madhura
          Hello and welcome.

          I suggest you post questions about code in the General and Desktop forum, not the Jobs forum, which is for advertising/requesting jobs.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @JonB I moved the topic

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • JonBJ JonB

            @Madhura
            Hello and welcome.

            I suggest you post questions about code in the General and Desktop forum, not the Jobs forum, which is for advertising/requesting jobs.

            M Offline
            M Offline
            Madhura
            wrote on last edited by Madhura
            #5

            @hskoglund

            Already the def is present with DumpIDL data still we are facing this same issueQTcmdidl.PNG defsymbol.PNG

            JonBJ 1 Reply Last reply
            0
            • M Madhura

              @hskoglund

              Already the def is present with DumpIDL data still we are facing this same issueQTcmdidl.PNG defsymbol.PNG

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @Madhura If you are replying to @hskoglund please address his name not mine.

              1 Reply Last reply
              0
              • hskoglundH Offline
                hskoglundH Offline
                hskoglund
                wrote on last edited by
                #7

                Hi, to make sure the DumpIDL symbol is present in the .dll, open a MSVC2017 CMD window:

                dumpbin /exports "C:\Users\....\QtComSupportDll.dll"
                

                DumpIDL should be seen..

                Also the Qt examples like ActiveQt simple, it's an .exe not a .dll but it also uses a .DEF file to include the DumpIDL symbol. If you build it, does idc.exe work on it?

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved