EVNTEXT.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:4k
源码类别:

Windows编程

开发平台:

Visual C++

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  File Name 
  4. //      EVNTEXT.H
  5. //
  6. //  Description
  7. //      Interface Methods are declared in this file for evntext.cpp
  8. //
  9. //  Author
  10. //      Gary Peluso
  11. //
  12. //  Revision: 1.00
  13. //
  14. // Written for Microsoft Windows Developer Support
  15. // Copyright (c) 1992-1995 Microsoft Corporation. All rights reserved.
  16. //
  17. #ifndef __EVNTEXT_H__
  18. #define __EVNTEXT_H__
  19. #include <WINDOWS.H> 
  20. #include <COMMCTRL.H>
  21. #include <MAPIX.H>
  22. #include <MAPIUTIL.H>
  23. #include <MAPIFORM.H>
  24. #include <EXCHEXT.H>
  25. #include "RESOURCE.H"
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //    Prototypes
  28. //
  29. extern "C"
  30. {
  31.  LPEXCHEXT CALLBACK ExchEntryPoint(void);
  32. }
  33. void ErrorMessageBox(HWND hWnd, HRESULT hr, 
  34.         LPSTR szFunction, LPSTR szMessage);
  35. HRESULT CalcULONGCheckSum(LPMESSAGE pMessage, ULONG *pulCheckSum);
  36. BOOL CALLBACK SignatureOptionsDlgProc(HWND hDlg, UINT uMsg, 
  37.         WPARAM wParam, LPARAM lParam);
  38. ///////////////////////////////////////////////////////////////////////////////
  39. //    Global Data Declarations
  40. //
  41. extern BOOL bSignatureOn;   // defined in EVNTEXT.CPP
  42. ///////////////////////////////////////////////////////////////////////////////
  43. //    forward declarations
  44. //
  45. class MyExchExt;
  46. class MyExchExtPropertySheets;
  47. class MyExchExtMessageEvents;
  48. class MyExchExt : public IExchExt
  49. {
  50.  
  51.  public:
  52.     MyExchExt(); 
  53.     STDMETHODIMP QueryInterface
  54.                     (REFIID                     riid,
  55.                      LPVOID *                   ppvObj);
  56.     inline STDMETHODIMP_(ULONG) AddRef
  57.                     () { ++m_cRef; return m_cRef; };
  58.     STDMETHODIMP_(ULONG) Release(); 
  59.     STDMETHODIMP Install (LPEXCHEXTCALLBACK pmecb, 
  60.                         ULONG mecontext, ULONG ulFlags);
  61.     
  62.  private:
  63.     ULONG m_cRef;
  64.     UINT  m_context;
  65.     MyExchExtPropertySheets * m_pExchExtPropertySheets;
  66.     MyExchExtMessageEvents * m_pExchExtMessageEvents;
  67. };
  68. class MyExchExtPropertySheets : public IExchExtPropertySheets
  69. {
  70.  public:
  71.     MyExchExtPropertySheets (LPUNKNOWN pParentInterface) { 
  72.     m_pExchExt = pParentInterface;
  73.     m_cRef = 0; 
  74.     };
  75.     
  76.     STDMETHODIMP QueryInterface
  77.                     (REFIID                     riid,
  78.                      LPVOID *                   ppvObj);
  79.     inline STDMETHODIMP_(ULONG) AddRef
  80.                     () { ++m_cRef; return m_cRef; };
  81.     inline STDMETHODIMP_(ULONG) Release
  82.                     () { ULONG ulCount = --m_cRef;
  83.                          if (!ulCount) { delete this; }
  84.                          return ulCount;};
  85.     STDMETHODIMP_ (ULONG) GetMaxPageCount(ULONG ulFlags);          
  86.     STDMETHODIMP  GetPages(LPEXCHEXTCALLBACK peecb,
  87.                           ULONG ulFlags, LPPROPSHEETPAGE ppsp, ULONG FAR * pcpsp);          
  88.     STDMETHODIMP_ (VOID) FreePages(LPPROPSHEETPAGE ppsp, ULONG ulFlags, 
  89.                                          ULONG cpsp);          
  90.  private:
  91.     ULONG m_cRef;
  92.     LPUNKNOWN m_pExchExt;
  93. };
  94. class MyExchExtMessageEvents : public IExchExtMessageEvents
  95. {
  96.  public:
  97.     MyExchExtMessageEvents (LPUNKNOWN pParentInterface) { 
  98.     m_pExchExt = pParentInterface;
  99.     m_cRef = 0; 
  100.     m_bInSubmitState = FALSE;
  101.     };
  102.     STDMETHODIMP QueryInterface
  103.                     (REFIID                     riid,
  104.                      LPVOID *                   ppvObj);
  105.     inline STDMETHODIMP_(ULONG) AddRef
  106.                     () { ++m_cRef; return m_cRef; };
  107.     inline STDMETHODIMP_(ULONG) Release
  108.                     () { ULONG ulCount = --m_cRef;
  109.                          if (!ulCount) { delete this; }
  110.                          return ulCount;};
  111.     STDMETHODIMP OnRead(LPEXCHEXTCALLBACK lpeecb);
  112.     STDMETHODIMP OnReadComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
  113.     STDMETHODIMP OnWrite(LPEXCHEXTCALLBACK lpeecb);
  114.     STDMETHODIMP OnWriteComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
  115.     STDMETHODIMP OnCheckNames(LPEXCHEXTCALLBACK lpeecb);
  116.     STDMETHODIMP OnCheckNamesComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
  117.     STDMETHODIMP OnSubmit(LPEXCHEXTCALLBACK lpeecb);
  118.     STDMETHODIMP_ (VOID)OnSubmitComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
  119.  private:
  120.     ULONG   m_cRef;
  121.     HRESULT m_hrOnReadComplete;
  122.     BOOL    m_bInSubmitState;
  123.     LPUNKNOWN m_pExchExt;
  124. };
  125. #endif // __EVNTEXT_H__