Guest User

Untitled

a guest
Apr 16th, 2014
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Simple .NET ActiveX which is Raising an event when start() called.
  2. namespace RandomColorGenerator
  3. {
  4. [ClassInterface(ClassInterfaceType.None), Guid("5E20404E-43FC-4A16-873A-C79D36B99750"), ProgId("RandomColorGenerator.ColorGenerator")]
  5. public class ColorGenerator : IColorGenerator
  6. {
  7. public event EventHandler ColorGenerated;
  8.  
  9. public void start()
  10. {
  11. EventHandler handler = ColorGenerated;
  12. if (handler != null)
  13. {
  14. handler(this, EventArgs.Empty);
  15. }
  16. Console.WriteLine("ColorGenerator::Start");
  17. }
  18.  
  19. public void stop()
  20. {
  21. Console.WriteLine("ColorGenerator::Stop");
  22. }
  23.  
  24. public string color()
  25. {
  26. return "#00FF00";
  27. }
  28. }
  29. }
  30.  
  31. //Qt Code which is initializing that activeX
  32. QAxObject *object = new QAxObject("RandomColorGenerator.ColorGenerator");
  33. //Works fine
  34. object->dynamicCall("stop()");
  35. //getting error : Object::connect: No such signal QAxObject::ColorGenerated(IDispatch*)
  36. QObject::connect(object, SIGNAL(ColorGenerated(IDispatch*)), this, SLOT(onColorGenerated(IDispatch*)));
  37.  
  38. //dumpcpp tool doc output
  39.  
  40. Public Slots:
  41.  
  42. bool Equals(QVariant obj);
  43. int GetHashCode();
  44. mscorlib::_Type* GetType();
  45. void add_ColorGenerated(mscorlib::_EventHandler* value);
  46. QString color();
  47. void remove_ColorGenerated(mscorlib::_EventHandler* value);
  48. void start();
  49. void stop();
  50.  
  51. Signals:
  52.  
  53. void exception(int code, QString source, QString disc, QString help);
  54. void propertyChanged(QString name);
  55. void signal(QString name, int argc, void* argv);
RAW Paste Data