1
0

external.h 995 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef NULLSOFT_WEBDEV_PLUGIN_EXTERNAL_HEADER
  2. #define NULLSOFT_WEBDEV_PLUGIN_EXTERNAL_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../nu/dispatchTable.h"
  8. class ExternalDispatch : public IDispatch
  9. {
  10. public:
  11. typedef enum
  12. {
  13. DISPATCH_SERVICE_OPEN = 700,
  14. DISPATCH_SERVICE_CREATE = 701,
  15. DISPATCH_SERVICE_GETINFO = 702,
  16. DISPATCH_SERVICE_SETINFO = 703,
  17. } DispatchCodes;
  18. protected:
  19. ExternalDispatch();
  20. ~ExternalDispatch();
  21. public:
  22. static HRESULT CreateInstance(ExternalDispatch **instance);
  23. static LPCWSTR GetName();
  24. public:
  25. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  26. STDMETHOD_(ULONG, AddRef)(void);
  27. STDMETHOD_(ULONG, Release)(void);
  28. protected:
  29. DISPTABLE_INCLUDE();
  30. DISPHANDLER_REGISTER(OnServiceOpen);
  31. DISPHANDLER_REGISTER(OnServiceCreate);
  32. DISPHANDLER_REGISTER(OnServiceGetInfo);
  33. DISPHANDLER_REGISTER(OnServiceSetInfo);
  34. protected:
  35. ULONG ref;
  36. };
  37. #endif //NULLSOFT_WEBDEV_PLUGIN_EXTERNAL_HEADER