Call .NET C# dll from QT ?
-
Hi ,
I'm new in C++ and QT and I need some help.
I have built a com object (not something visual) with some methods and the task is to call my .NET C# dll from inside QT (a console application or even a Windows Application).
I read the documentation and tried unsuccessfully to make that call happen.I read the below
http://doc.qt.digia.com/4.6/qaxbase.html#control-prop
https://qt-project.org/doc/qt-4.7/activeqt-dotnet.htmlbut without success.
Can anyone has a small snippet of code on how to do this in QT ?
Is QT supports that ?I tried to use this
QAxObject object("C:/Myfolder/MyCOM.dll")
but I got an unresolved something
I tried this
QLibrary lib( "C:\Myfolder\MyCOM.dll" );
lib.load();
but it was not loaded.
I ran out of ideas .Appreciate any help you could give me.
thank you in advance -
You need to resolve the functions you would like to call in the dll. The "QLibrary documentation":http://qt-project.org/doc/qt-5/QLibrary.html shows an example.
Create a typedef for the function prototype, then resolve the function by name.
-
I apologize, you are correct. QLibrary is only for C.
There is a good example on the QAxBase docs "here":https://qt-project.org/doc/qt-4.7/qaxbase.html, although I have only used QAxObject to populate Microsoft excel documents