Home COM GDI+ WebBrowser Data Access

IMAPIMessageSite Interface

 

IID_IMAPIMessageSite

{00020370-0000-0000-C000-000000000046}

 

 

The IMAPIMessageSite interface manipulates messages and is implemented by the form viewer code—typically a client application—that responds to such manipulation.

 

 


' ****************************************************************************************
' IMAPIMessageSite interface
' $IID_IMAPIMessageSite = GUID$("{00020370-0000-0000-C000-000000000046}")
' The IMAPIMessageSite interface manipulates messages and is implemented by the form
' viewer code--typically a client application--that responds to such manipulation.
' ****************************************************************************************

' ========================================================================================
' IUnknown virtual table
' ========================================================================================
TYPE IMAPIMessageSite_IUnknownVtbl
   ' IUnknown interface
   QueryInterface AS DWORD           ' Returns pointers to supported interfaces
   AddRef AS DWORD                   ' Increments reference count
   Release AS DWORD                  ' Decrements reference count
   ' IMAPIMessageSite interface
   GetSession AS DWORD               ' GetSession method
   GetStore AS DWORD                 ' GetStore method
   GetFolder AS DWORD                ' GetFolder method
   GetMessage AS DWORD               ' GetMessage method
   GetFormManager AS DWORD           ' GetFormManager method
   NewMessage AS DWORD               ' NewMessage method
   CopyMessage AS DWORD              ' CopyMessage method
   MoveMessage AS DWORD              ' MoveMessage method
   DeleteMessage AS DWORD            ' DeleteMessage method
   SaveMessage AS DWORD              ' SaveMessage method
   SubmitMessage AS DWORD            ' SubmitMessage method
   GetSiteStatus AS DWORD            ' GetSiteStatus method
   ' Custom data
   pVtblAddr AS DWORD                ' Address of the virtual table
   cRef AS DWORD                     ' Reference counter
   pthis AS DWORD                    ' IUnknown of the control that fires the events
END TYPE
' ========================================================================================

' ========================================================================================
' Builds the IUnknown Virtual Table
' ========================================================================================
FUNCTION IMAPIMessageSite_BuildVtbl (BYVAL pthis AS DWORD) AS DWORD

   LOCAL pVtbl AS IMAPIMessageSite_IUnknownVtbl PTR
   LOCAL pUnk AS IMAPIMessageSite_IUnknownVtbl PTR

   pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
   IF pVtbl = 0 THEN EXIT FUNCTION

   @pVTbl.QueryInterface        = CODEPTR(IMAPIMessageSite_QueryInterface)
   @pVTbl.AddRef                = CODEPTR(IMAPIMessageSite_AddRef)
   @pVTbl.Release               = CODEPTR(IMAPIMessageSite_Release)
   @pVTbl.GetSession            = CODEPTR(IMAPIMessageSite_GetSession)
   @pVTbl.GetStore              = CODEPTR(IMAPIMessageSite_GetStore)
   @pVTbl.GetFolder             = CODEPTR(IMAPIMessageSite_GetFolder)
   @pVTbl.GetMessage            = CODEPTR(IMAPIMessageSite_GetMessage)
   @pVTbl.GetFormManager        = CODEPTR(IMAPIMessageSite_GetFormManager)
   @pVTbl.NewMessage            = CODEPTR(IMAPIMessageSite_NewMessage)
   @pVTbl.CopyMessage           = CODEPTR(IMAPIMessageSite_CopyMessage)
   @pVTbl.MoveMessage           = CODEPTR(IMAPIMessageSite_MoveMessage)
   @pVTbl.DeleteMessage         = CODEPTR(IMAPIMessageSite_DeleteMessage)
   @pVTbl.SaveMessage           = CODEPTR(IMAPIMessageSite_SaveMessage)
   @pVTbl.SubmitMessage         = CODEPTR(IMAPIMessageSite_SubmitMessage)
   @pVTbl.GetSiteStatus         = CODEPTR(IMAPIMessageSite_GetSiteStatus)
   @pVtbl.pVtblAddr             = pVtbl
   @pVtbl.pthis                 = pthis

   pUnk = VARPTR(@pVtbl.pVtblAddr)
   FUNCTION = pUnk

END FUNCTION
' ========================================================================================

' ========================================================================================
' UI4 AddRef()
' Increments the reference counter.
' ========================================================================================
FUNCTION IMAPIMessageSite_AddRef (BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR) AS DWORD
   INCR @@pIMAPIMessageSite.cRef
   FUNCTION = @@pIMAPIMessageSite.cRef
END FUNCTION
' ========================================================================================

' ========================================================================================
' HRESULT QueryInterface([in] *GUID riid, [out] **VOID ppvObj)
' Returns the IUnknown of our class and increments the reference counter.
' ========================================================================================
FUNCTION IMAPIMessageSite_QueryInterface (BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
   ppvObj = pIMAPIMessageSite
   IMAPIMessageSite_AddRef pIMAPIMessageSite
   FUNCTION = %S_OK
END FUNCTION
' ========================================================================================

' ========================================================================================
' UI4 Release()
' Releases our class if there is only a reference to him and decrements the reference counter.
' ========================================================================================
FUNCTION IMAPIMessageSite_Release (BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR) AS DWORD
   LOCAL pVtblAddr AS DWORD
   IF @@pIMAPIMessageSite.cRef = 1 THEN
      pVtblAddr = @@pIMAPIMessageSite.pVtblAddr
      IF ISTRUE HeapFree(GetProcessHeap(), 0, BYVAL pVtblAddr) THEN
         FUNCTION = 0
         EXIT FUNCTION
      ELSE
         FUNCTION = @@pIMAPIMessageSite.cRef
         EXIT FUNCTION
      END IF
   END IF
   DECR @@pIMAPIMessageSite.cRef
   FUNCTION = @@pIMAPIMessageSite.cRef
END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::GetSession
' The IMAPIMessageSite::GetSession method returns the MAPI session in which the current
' message was created or opened.
' ========================================================================================
FUNCTION IMAPIMessageSite_GetSession ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYREF ppSession AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %S_FALSE No session exists for the current message.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::GetStore
' The IMAPIMessageSite::GetStore method returns the message store containing the current
' message, if such a store exists. This method will return NULL in the ppStore parameter
' for embedded messages, which are stored within another message rather than directly in
' a message store.
' ========================================================================================
FUNCTION IMAPIMessageSite_GetStore ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYREF ppStore AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %S_FALSE There is no store containing the message.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::GetFolder
' The IMAPIMessageSite::GetFolder method returns the folder in which the current message
' was created or opened, if such a folder exists. This method returns NULL in the ppFolder
' parameter for embedded messages, which are not stored directly in a folder.
' ========================================================================================
FUNCTION IMAPIMessageSite_GetFolder ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYREF ppFolder AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %S_FALSE No folder exists for the message.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::GetMessage
' The IMAPIMessageSite::GetMessage method returns the current message.
' ========================================================================================
FUNCTION IMAPIMessageSite_GetMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYREF ppMessage AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %S_FALSE No message currently exists for the calling form.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::GetFormManager
' The IMAPIMessageSite::GetFormManager method returns a form manager interface, which a
' form server can use to launch another form server.
' ========================================================================================
FUNCTION IMAPIMessageSite_GetFormManager ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYREF ppFormMgr AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::NewMessage
' The IMAPIMessageSite::NewMessage method creates a new message.
' ========================================================================================
FUNCTION IMAPIMessageSite_NewMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYVAL fComposeInFolder AS DWORD _
, BYVAL pFolderFocus AS DWORD _
, BYVAL pPersistMessage AS DWORD _
, BYREF ppMessage AS DWORD _
, BYREF ppMessageSite AS DWORD _
, BYREF ppViewContext AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::CopyMessage
' The IMAPIMessageSite::CopyMessage method copies the current message to a folder.
' ========================================================================================
FUNCTION IMAPIMessageSite_CopyMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYVAL pFolderDestination AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %MAPI_E_NO_SUPPORT The operation is not supported by this message site.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::MoveMessage
' The IMAPIMessageSite::MoveMessage method moves the current message to a folder.
' ========================================================================================
FUNCTION IMAPIMessageSite_MoveMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYVAL pFolderDestination AS DWORD _
, BYVAL pViewContext AS DWORD _
, BYREF prcPosRect AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %MAPI_E_NO_SUPPORT The operation is not supported by this message site.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::DeleteMessage
' The IMAPIMessageSite::DeleteMessage method deletes the current message.
' ========================================================================================
FUNCTION IMAPIMessageSite_DeleteMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYVAL pViewContext AS DWORD _
, BYREF prcPosRect AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.
' %MAPI_E_NO_SUPPORT The operation is not supported by this message site.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::SaveMessage
' The IMAPIMessageSite::SaveMessage method requests that the current message be saved.
' ========================================================================================
FUNCTION IMAPIMessageSite_SaveMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::SubmitMessage
' The IMAPIMessageSite::SubmitMessage method requests that the current message be
' submitted to the MAPI spooler.
' ========================================================================================
FUNCTION IMAPIMessageSite_SubmitMessage ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYVAL ulFlags AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.

END FUNCTION
' ========================================================================================

' ========================================================================================
' IMAPIMessageSite::GetSiteStatus
' The IMAPIMessageSite::GetSiteStatus method returns information from a message site
' object about the message site's capabilities for the current message.
' ========================================================================================
FUNCTION IMAPIMessageSite_GetSiteStatus ( _
  BYVAL BYVAL pIMAPIMessageSite AS IMAPIMessageSite_IUnknownVtbl PTR _
, BYVAL lpulStatus AS DWORD _
) AS LONG

   ' *** Put your code here ***

' Return Values
' %S_OK  The call succeeded and has returned the expected value or values.

END FUNCTION
' ========================================================================================
 

 

Page last updated on Monday, 03 April 2006 20:15:25 +0200