Thanks for your reply.
What I'm looking for is how to create an Assembly or COM component from an QT Application?

I realize that a com component need some kind of GUIID and a need to extract the functions from the application.
This is what I got right now:


Qt Code:
  1. #define APPTOLIB_EXPORT Q_DECL_EXPORT
  2. using namespace std;
  3. class APPTOLIB_EXPORT MyMathFuncs : public QObject
  4. {
  5. Q_OBJECT
  6.  
  7. Q_CLASSINFO("ClassID", "{b50a71db-c4a7-4551-8d14-49983566afee}")
  8. Q_CLASSINFO("InterfaceID", "{4a427759-16ef-4ed8-be79-59ffe5789042}")
  9. Q_CLASSINFO("RegisterObject", "yes")
  10.  
  11. public:
  12. MyMathFuncs(QObject* parent = 0);
  13. // Returns a + b
  14. static double Add(double a, double b);
  15.  
  16. // Returns a / b
  17. // Throws DivideByZeroException if b is 0
  18. static double Divide(double a, double b);
  19. };
  20.  
  21. MyMathFuncs::MyMathFuncs(QObject *parent) : QObject(parent)
  22. {
  23. setObjectName("From QAxFactory");
  24. }
  25.  
  26. double MyMathFuncs::Add(double a, double b)
  27. {
  28. return a + b;
  29. }
  30.  
  31. double MyMathFuncs::Divide(double a, double b)
  32. {
  33. if (b == 0)
  34. {
  35. throw new invalid_argument("b cannot be zero!");
  36. }
  37.  
  38. return a / b;
  39. }
  40.  
  41.  
  42. QAXFACTORY_BEGIN("{edd3e836-f537-4c6f-be7d-6014c155cc7a}", "{b7da3de8-83bb-4bbe-9ab7-99a05819e201}")
  43. QAXCLASS(MyMathFuncs)
  44. QAXFACTORY_END()
To copy to clipboard, switch view to plain text mode 

I can access the interface but I don't get up any functions. I've been able to extract seperate functions but when adding them to a class I only get an interface when adding the reference to my visual studio solution. I which to be able to create a new object of MyMathFuncs and then access the functions which I've made available.

Maybe my title wasn't so well written but what I want is to use my QT c++ class by adding a dll as reference in Visual Studio C# where I can then get hold of the functions/classes which I have made extern.?