From QT-COM Create IDL from DLL.
-
wrote on 31 May 2023, 08:17 last edited by 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.
- We have created a DLL project.
- Building the project it properly builds and generates the dll.
- 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_OBJECTQAXFACTORY_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;}
-
wrote on 31 May 2023, 09:26 last edited by
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
-
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.
- We have created a DLL project.
- Building the project it properly builds and generates the dll.
- 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_OBJECTQAXFACTORY_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;}
-
-
@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.
@JonB I moved the topic
-
@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.
wrote on 1 Jun 2023, 06:10 last edited by Madhura 6 Jan 2023, 06:50 -
Already the def is present with DumpIDL data still we are facing this same issue
wrote on 1 Jun 2023, 06:13 last edited by@Madhura If you are replying to @hskoglund please address his name not mine.
-
wrote on 1 Jun 2023, 06:47 last edited by
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/7