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.

139 lines
4.4 KiB

  1. #ifndef __NmApp_h__
  2. #define __NmApp_h__
  3. #include "rToolbar.h"
  4. #include "resource.h" // main symbols
  5. #include "NetMeeting.h"
  6. #include <NetMeetingCP.h>
  7. class CMainUI;
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CNetMeetingObj
  10. class ATL_NO_VTABLE CNetMeetingObj :
  11. public CComObjectRootEx<CComSingleThreadModel>,
  12. public IDispatchImpl<INetMeeting, &IID_INetMeeting, &LIBID_NetMeetingLib>,
  13. public CComControl<CNetMeetingObj>,
  14. public IPersistStreamInitImpl<CNetMeetingObj>,
  15. public IPersistPropertyBagImpl<CNetMeetingObj>,
  16. public IOleControlImpl<CNetMeetingObj>,
  17. public IOleObjectImpl<CNetMeetingObj>,
  18. public IOleInPlaceActiveObjectImpl<CNetMeetingObj>,
  19. public IViewObjectExImpl<CNetMeetingObj>,
  20. public IOleInPlaceObjectWindowlessImpl<CNetMeetingObj>,
  21. public CComCoClass<CNetMeetingObj, &CLSID_NetMeeting>,
  22. public IObjectSafetyImpl<CNetMeetingObj, INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>,
  23. public IConnectionPointContainerImpl<CNetMeetingObj>,
  24. public CProxy_INetMeetingEvents<CNetMeetingObj>,
  25. public IProvideClassInfo2Impl<&CLSID_NetMeeting, &DIID__INetMeetingEvents, &LIBID_NetMeetingLib, NetMeetingLib_Ver_Major, NetMeetingLib_Ver_Minor>
  26. {
  27. // Static Data
  28. static CSimpleArray<CNetMeetingObj*>* ms_pNetMeetingObjList;
  29. CMainUI* m_pMainView;
  30. CMainUI::CreateViewMode m_CreateMode;
  31. public:
  32. // So we are not released when we set up our notificatinos sink
  33. DECLARE_PROTECT_FINAL_CONSTRUCT()
  34. // Because this is in a local server, we are not going to be able to be aggregated...
  35. DECLARE_NOT_AGGREGATABLE(CNetMeetingObj)
  36. // This is the resource ID for the .rgs file
  37. DECLARE_REGISTRY_RESOURCEID(IDR_NMAPP)
  38. BEGIN_COM_MAP(CNetMeetingObj)
  39. COM_INTERFACE_ENTRY(INetMeeting)
  40. COM_INTERFACE_ENTRY(IDispatch)
  41. COM_INTERFACE_ENTRY(IObjectSafety)
  42. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  43. COM_INTERFACE_ENTRY(IProvideClassInfo)
  44. COM_INTERFACE_ENTRY(IProvideClassInfo2)
  45. COM_INTERFACE_ENTRY(IViewObjectEx)
  46. COM_INTERFACE_ENTRY(IViewObject2)
  47. COM_INTERFACE_ENTRY(IViewObject)
  48. COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
  49. COM_INTERFACE_ENTRY(IOleInPlaceObject)
  50. COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
  51. COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
  52. COM_INTERFACE_ENTRY(IOleControl)
  53. COM_INTERFACE_ENTRY(IOleObject)
  54. COM_INTERFACE_ENTRY(IPersistStreamInit)
  55. COM_INTERFACE_ENTRY(IPersistPropertyBag)
  56. COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
  57. END_COM_MAP()
  58. BEGIN_CONNECTION_POINT_MAP(CNetMeetingObj)
  59. CONNECTION_POINT_ENTRY(DIID__INetMeetingEvents)
  60. END_CONNECTION_POINT_MAP()
  61. BEGIN_PROP_MAP(CNetMeetingObj)
  62. END_PROP_MAP()
  63. BEGIN_MSG_MAP(CNetMeetingObj)
  64. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  65. MESSAGE_HANDLER(WM_SIZE, OnSize)
  66. DEFAULT_REFLECTION_HANDLER()
  67. END_MSG_MAP()
  68. // Construction / Destruction
  69. CNetMeetingObj();
  70. ~CNetMeetingObj();
  71. HRESULT FinalConstruct();
  72. static HRESULT InitSDK();
  73. static void CleanupSDK();
  74. static UINT GetObjectCount() { return ms_pNetMeetingObjList ? ms_pNetMeetingObjList->GetSize() : 0; };
  75. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  76. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  77. ///////////////////////////////////////////////////////////////////////////
  78. // IViewObjectEx stuff
  79. ///////////////////////////////////////////////////////////////////////////
  80. DECLARE_VIEW_STATUS(0)
  81. ///////////////////////////////////////////////////////////////////////////
  82. // CComControl Stuff
  83. ///////////////////////////////////////////////////////////////////////////
  84. virtual HWND CreateControlWindow(HWND hWndParent, RECT& rcPos);
  85. ///////////////////////////////////////////////////////////////////////////
  86. // INetMeeting methods
  87. /////////////////////////////////////////////////////////////
  88. STDMETHOD(Version)(long* pdwBuildNumber);
  89. STDMETHOD(UnDock)();
  90. STDMETHOD(IsInConference)(BOOL *pbInConference);
  91. STDMETHOD(CallTo)(BSTR bstrCallToString);
  92. STDMETHOD(LeaveConference)();
  93. // IPersistPropertyBag
  94. STDMETHOD(Load)(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog);
  95. // IPersistStreamInit
  96. STDMETHOD(Load)(LPSTREAM pStm);
  97. /////////////////////////////////////////////////////////////
  98. // IProvideClassInfo2
  99. STDMETHOD(GetClassInfo)(ITypeInfo** pptinfo);
  100. // Events
  101. static void Broadcast_ConferenceStarted();
  102. static void Broadcast_ConferenceEnded();
  103. private:
  104. void CNetMeetingObj::_SetMode(LPCTSTR pszMode);
  105. STDMETHODIMP _ParseInitString(LPCTSTR *ppszInitString, LPTSTR szName, LPTSTR szValue);
  106. };
  107. #endif //__NmApp_h__