use a COM ( or a .Net ) object in a c++ QT application
Hi to all I have a problem.
I have to build a program in C++ with Qt and I have to use some routines contained in a dll.
I have to version of the same dll
I would know how to use the routines in my qt application. I read about ActiveQt but I'm not sure is what I need.
And which version of the dll can I use? The COM or the .net version?
Regards
Re: use a COM ( or a .Net ) object in a c++ QT application
you can use both .net and com version.. I dont know much about this, you can try looking into the examples provided in the Qt Installation. There are many examples, one such for COM version and also for .NET. They can provide more information about this.. try Qt Assistant which comes with Qt SDK, it has detail explanation of the coding for the examples and maybe on how to do what you are asking for...
Re: use a COM ( or a .Net ) object in a c++ QT application
Quote:
Originally Posted by
arpspatel
you can use both .net and com version.. I dont know much about this, you can try looking into the examples provided in the Qt Installation. There are many examples, one such for COM version and also for .NET. They can provide more information about this.. try Qt Assistant which comes with Qt SDK, it has detail explanation of the coding for the examples and maybe on how to do what you are asking for...
I read the assistant and I gave a look at the example but I can not find for example the point where it load the dll
Re: use a COM ( or a .Net ) object in a c++ QT application
for loading dll u can use this.. its used in .NET activeQt example
#using <dllname.dll>
http://doc.qt.nokia.com/4.6/activeqt-dotnet.html
here is sample code from the example
Code:
#include <QString>
#using <mscorlib.dll>
#include <vcclr.h>
using namespace System;
String
*QStringToString
(const QString &qstring
) {
return new String((const wchar_t *)qstring.utf16());
}
QString StringToQString
(String
*string
) {
const wchar_t __pin *chars = PtrToStringChars(string);
return QString::fromWCharArray(chars
);
}
use can also use QLibrary for loading dlls, not sure if it will work for .NET or COM.. give it a try..
Re: use a COM ( or a .Net ) object in a c++ QT application
My problem is the inverse.
I would use a COM object in a C++ program
Re: use a COM ( or a .Net ) object in a c++ QT application
Quote:
Originally Posted by
arpspatel
for loading dll u can use this.. its used in .NET activeQt example
#using <dllname.dll>
http://doc.qt.nokia.com/4.6/activeqt-dotnet.html
here is sample code from the example
Code:
#include <QString>
#using <mscorlib.dll>
#include <vcclr.h>
using namespace System;
String
*QStringToString
(const QString &qstring
) {
return new String((const wchar_t *)qstring.utf16());
}
QString StringToQString
(String
*string
) {
const wchar_t __pin *chars = PtrToStringChars(string);
return QString::fromWCharArray(chars
);
}
use can also use QLibrary for loading dlls, not sure if it will work for .NET or COM.. give it a try..
Hi I'm trying your suggestion but I still don't understand how to get the pointer of the dll routines and call them.
Why there is no a simple and clear example?
as this:
Code:
code for load com/.net dll
Code:
get routine pointers
Code:
call routine myroutine(param1, param2) with param 1 and 2
Is too difficult to provide a simple example?
Re: use a COM ( or a .Net ) object in a c++ QT application
Hi,
I have the same problem, looking for a simple example
Vitor