Leaked source code of windows server 2003
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.

99 lines
2.4 KiB

  1. /*
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. smapi.h
  5. Abstract:
  6. Definition of the Csmapi class
  7. Revision History:
  8. created steveshi 08/23/00
  9. */
  10. #ifndef __SMAPI_H_
  11. #define __SMAPI_H_
  12. #include "resource.h" // main symbols
  13. /////////////////////////////////////////////////////////////////////////////
  14. // Csmapi
  15. class ATL_NO_VTABLE Csmapi :
  16. public CComObjectRootEx<CComSingleThreadModel>,
  17. public CComCoClass<Csmapi, &CLSID_smapi>,
  18. public ISupportErrorInfo,
  19. public IDispatchImpl<Ismapi, &IID_Ismapi, &LIBID_RCBDYCTLLib>
  20. {
  21. public:
  22. Csmapi()
  23. {
  24. m_bLogonOK = FALSE;
  25. m_lhSession = NULL;
  26. m_hLib = NULL;
  27. m_lpfnMapiFreeBuf = NULL;
  28. m_lpfnMapiAddress = NULL;
  29. m_lOEFlag = 0;
  30. m_szSmapiName[0] = _T('\0');
  31. m_szDllPath[0] = _T('\0');
  32. }
  33. ~Csmapi();
  34. DECLARE_REGISTRY_RESOURCEID(IDR_SMAPI)
  35. DECLARE_PROTECT_FINAL_CONSTRUCT()
  36. BEGIN_COM_MAP(Csmapi)
  37. COM_INTERFACE_ENTRY(Ismapi)
  38. COM_INTERFACE_ENTRY(IDispatch)
  39. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  40. END_COM_MAP()
  41. // ISupportsErrorInfo
  42. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  43. // Ismapi
  44. public:
  45. STDMETHOD(get_AttachedXMLFile)(/*[out, retval]*/ BSTR *pVal);
  46. STDMETHOD(put_AttachedXMLFile)(/*[in]*/ BSTR newVal);
  47. STDMETHOD(get_Body)(/*[out, retval]*/ BSTR *pVal);
  48. STDMETHOD(put_Body)(/*[in]*/ BSTR newVal);
  49. STDMETHOD(get_Subject)(/*[out, retval]*/ BSTR *pVal);
  50. STDMETHOD(put_Subject)(/*[in]*/ BSTR newVal);
  51. STDMETHOD(SendMail)(/*[out, retval]*/ LONG* plStatus);
  52. STDMETHOD(Logoff)();
  53. STDMETHOD(Logon)(ULONG *plRet);
  54. protected:
  55. HRESULT get_SMAPIClientName(BSTR *pVal);
  56. HRESULT get_IsSMAPIClient_OE(LONG *pVal);
  57. HRESULT get_Reload(LONG *pVal);
  58. void PopulateAndThrowErrorInfo(ULONG err);
  59. BOOL IsOEConfig();
  60. HMODULE LoadOE();
  61. public:
  62. void MAPIFreeBuffer( MapiRecipDesc* p );
  63. protected:
  64. BOOL m_bLogonOK;
  65. CComBSTR m_bstrSubject;
  66. CComBSTR m_bstrBody;
  67. CComBSTR m_bstrXMLFile;
  68. public:
  69. // MAPI variables
  70. HMODULE m_hLib;
  71. LHANDLE m_lhSession;
  72. // MAPI functions
  73. LPMAPIFREEBUFFER m_lpfnMapiFreeBuf;
  74. LPMAPIADDRESS m_lpfnMapiAddress;
  75. TCHAR m_szSmapiName[MAX_PATH];
  76. TCHAR m_szDllPath[MAX_PATH];
  77. LONG m_lOEFlag;
  78. };
  79. #endif //__SMAPI_H_