Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Linking DLL files
Dachangel last edited by
I need to link a DLL file into a QT application. the DLL file was compiled from C# Visual Studio 2010 and I have the source code and project files the DLL was created from. I've spent about three hours looking around the net and haven't even the foggiest on how to do this, or whether I even can. All the information i can find relates to C++ or C.
The DLL file is a few classes to create an Engine object, and methods to be called on this object. I would greatly appreciate any help you can give me.
if it is a C# library, you have a problem. I think, it does not only export C-style functions?
Then you can't use it from Qt, as Qt is unmanaged C++ and not managed .Net code.
That's the other way round, right? using C++/COM inside C#
Afaik, you can also create COM objects with C# and then use the COM objects.
But using a C# dll directly is not possible
Yes, COM objects (or maybe ActiveX objects) are somewhat proxy how to use managed .Net objects in unmanaged C++ app.
I'm not familiar with C#, but in fact, C# dll it's not "real" windows dynamic-link library, and cannot be loaded in a familar way in C++ code (i.e. LoadLibrary in windows, or dlsym in linux, mac, and in no case with QLibrary :: load).
what is a "real" windows dll?
Dll only means dynamic load library, which C# dlls are also. You only can't use them in C++. If you make native C-exports, you can also use C/C++ dlls in C#, VB, etc, but only C exports, not C++.
So there is no "real" windows dll. Afaik, even not on Linux (if you use more than C/C++ for developement).
Yes, you are right. I wanted to say resolve symbols instead of loading. About "real" windos dll I attempt to mention that a COM or ActiveX "dll" export only DllRegisterServer and DllUnregisterServer functions.
[quote author="cincirin" date="1301495891"]Yes, you are right. I wanted to say resolve symbols instead of loading. About "real" windos dll I attempt to mention that a COM or ActiveX "dll" export only DllRegisterServer and DllUnregisterServer functions.[/quote]
That is correct, and those are C-exports :-) Like in kernel32.dll etc.