I need some help now. I would love if someone could help we with "transferring" my QT based code to work with my C# application.
Lets say I have this simple QT Class:
class ItShouldWork : public QObject
{
Q_OBJECT
public:
ItShouldWork(QObject* parent = 0) : QObject(parent){}
QString id() const { return objectName(); }
};
Now I want to be able to access this class with Visual Studio C#, I've tried creating an unmanaged dll and access through an wrapper, tried to create an COM component but right now I'm completely stuck so I'm going back to the beginning with this simple class. I've seen that you can use an extern "C" with __declspec(dllexport) like this:
extern "C" __declspec(dllexport) double Subtract(double a, double b)
and then use _dllImport in .net, this works fine with the function above but when adding for example a QString to it it doesn't recognize my dll anymore and a dllNotFoundException is thrown.
Then I thought maybe you need a wrapper of some kind, yeah and how do you do that then..? googled away but nothing to really help me with c++ and qt functions.
A small step by step on how creating a dll and a c-wrapper or creating a COM component dll directly would be awesome, I don't really care how it's done but if you know a way, please help me with a small tutorial? I'm going crazy...