Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. RemoteDesktopClientEventSink
  5. Abstract:
  6. This listens to the events from the IRemoteDesktopClient so
  7. we can find out when the server connects.
  8. Author:
  9. Marc Reyhner 7/11/2000
  10. --*/
  11. #ifndef __REMOTEDESKTOPCLIENTEVENTSINK_H__
  12. #define __REMOTEDESKTOPCLIENTEVENTSINK_H__
  13. #define IDC_EVENT_SOURCE_OBJ 1
  14. //
  15. // Info for all the event functions is entered here
  16. // there is a way to have ATL do this automatically using typelib's
  17. // but it is slower.
  18. //
  19. static _ATL_FUNC_INFO EventFuncNoParamsInfo =
  20. {
  21. CC_STDCALL, // Calling convention.
  22. VT_EMPTY, // Return type.
  23. 0, // Number of arguments.
  24. {VT_EMPTY} // Argument types.
  25. };
  26. static _ATL_FUNC_INFO EventFuncLongParamInfo =
  27. {
  28. CC_STDCALL, // Calling convention.
  29. VT_EMPTY, // Return type.
  30. 1, // Number of arguments.
  31. {VT_I4} // Argument types.
  32. };
  33. // Forward declaration of CRemoteDesktopClientSession
  34. class CRemoteDesktopClientSession;
  35. ////////////////////////////////////////////////
  36. //
  37. // CRemoteDesktopClientEventSink
  38. //
  39. // Event sink for client events.
  40. //
  41. class CRemoteDesktopClientEventSink :
  42. public IDispEventSimpleImpl<IDC_EVENT_SOURCE_OBJ, CRemoteDesktopClientEventSink,
  43. &DIID__ISAFRemoteDesktopClientEvents>
  44. {
  45. public:
  46. BEGIN_SINK_MAP(CRemoteDesktopClientEventSink)
  47. SINK_ENTRY_INFO(IDC_EVENT_SOURCE_OBJ, DIID__ISAFRemoteDesktopClientEvents,
  48. 2, OnConnected,
  49. &EventFuncNoParamsInfo)
  50. SINK_ENTRY_INFO(IDC_EVENT_SOURCE_OBJ, DIID__ISAFRemoteDesktopClientEvents,
  51. 3, OnDisconnected,
  52. &EventFuncLongParamInfo)
  53. SINK_ENTRY_INFO(IDC_EVENT_SOURCE_OBJ, DIID__ISAFRemoteDesktopClientEvents,
  54. 4, OnRemoteControlRequestComplete,
  55. &EventFuncLongParamInfo)
  56. END_SINK_MAP()
  57. CRemoteDesktopClientEventSink(CRemoteDesktopClientSession *obj);
  58. //
  59. // Event Sinks
  60. //
  61. VOID __stdcall OnConnected();
  62. VOID __stdcall OnDisconnected(LONG reason);
  63. VOID __stdcall OnRemoteControlRequestComplete(LONG status);
  64. //
  65. // Return the name of this class.
  66. //
  67. virtual const LPTSTR ClassName() {
  68. return TEXT("CRemoteDesktopClientEventSink");
  69. }
  70. private:
  71. CRemoteDesktopClientSession *m_Obj;
  72. };
  73. #endif