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 31 May 2023, 08:17 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;}

    J 1 Reply Last reply 31 May 2023, 10:07
    0
    • H Online
      H Online
      hskoglund
      wrote on 31 May 2023, 09:26 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
        31 May 2023, 08:17

        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;}

        J Offline
        J Offline
        JonB
        wrote on 31 May 2023, 10:07 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.

        J M 2 Replies Last reply 31 May 2023, 11:27
        1
        • J jsulm moved this topic from Jobs on 31 May 2023, 11:27
        • J JonB
          31 May 2023, 10:07

          @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.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 31 May 2023, 11:27 last edited by
          #4

          @JonB I moved the topic

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

          1 Reply Last reply
          0
          • J JonB
            31 May 2023, 10:07

            @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 1 Jun 2023, 06:10 last edited by Madhura 6 Jan 2023, 06:50
            #5

            @hskoglund

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

            J 1 Reply Last reply 1 Jun 2023, 06:13
            0
            • M Madhura
              1 Jun 2023, 06:10

              @hskoglund

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

              J Offline
              J Offline
              JonB
              wrote on 1 Jun 2023, 06:13 last edited by
              #6

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

              1 Reply Last reply
              0
              • H Online
                H Online
                hskoglund
                wrote on 1 Jun 2023, 06:47 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

                1/7

                31 May 2023, 08:17

                • Login

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