|
|
|
IMAPIProgress Interface |
|
IID_IMAPIProgress |
{0002031F-0000-0000-C000-000000000046} |
|
The IMAPIProgress interface is used to implement a progress object an object for providing client applications with a progress indicator. A progress indicator is a user interface display that shows the percentage of completion of an operation, such as copying folders between message stores. MAPI and client applications implement progress objects and service providers use them.
|
' ****************************************************************************************
' IMAPIProgress interface
' $IID_IMAPIProgress = GUID$("{0002031F-0000-0000-C000-000000000046}")
' The IMAPIProgress interface is used to implement a progress object -- an object for
' providing client applications with a progress indicator. A progress indicator is a user
' interface display that shows the percentage of completion of an operation, such as
' copying folders between message stores. MAPI and client applications implement progress
' objects and service providers use them.
' ****************************************************************************************
' ========================================================================================
' IUnknown virtual table
' ========================================================================================
TYPE IMAPIProgress_IUnknownVtbl
' IUnknown interface
QueryInterface AS DWORD ' Returns pointers to supported interfaces
AddRef AS DWORD ' Increments reference count
Release AS DWORD ' Decrements reference count
' IMAPIProgress interface
Progress AS DWORD ' Progress method
GetFlags AS DWORD ' GetFlags method
GetMax AS DWORD ' GetMax method
GetMin AS DWORD ' GetMin method
SetLimits AS DWORD ' SetLimits 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 IMAPIProgress_BuildVtbl (BYVAL pthis AS DWORD) AS DWORD
LOCAL pVtbl AS IMAPIProgress_IUnknownVtbl PTR
LOCAL pUnk AS IMAPIProgress_IUnknownVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVTbl.QueryInterface = CODEPTR(IMAPIProgress_QueryInterface)
@pVTbl.AddRef = CODEPTR(IMAPIProgress_AddRef)
@pVTbl.Release = CODEPTR(IMAPIProgress_Release)
@pVTbl.Progress = CODEPTR(IMAPIProgress_Progress)
@pVTbl.GetFlags = CODEPTR(IMAPIProgress_GetFlags)
@pVTbl.GetMax = CODEPTR(IMAPIProgress_GetMax)
@pVTbl.GetMin = CODEPTR(IMAPIProgress_GetMin)
@pVTbl.SetLimits = CODEPTR(IMAPIProgress_SetLimits)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.pthis = pthis
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ========================================================================================
' ========================================================================================
' UI4 AddRef()
' Increments the reference counter.
' ========================================================================================
FUNCTION IMAPIProgress_AddRef (BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR) AS DWORD
INCR @@pIMAPIProgress.cRef
FUNCTION = @@pIMAPIProgress.cRef
END FUNCTION
' ========================================================================================
' ========================================================================================
' HRESULT QueryInterface([in] *GUID riid, [out] **VOID ppvObj)
' Returns the IUnknown of our class and increments the reference counter.
' ========================================================================================
FUNCTION IMAPIProgress_QueryInterface (BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
ppvObj = pIMAPIProgress
IMAPIProgress_AddRef pIMAPIProgress
FUNCTION = %S_OK
END FUNCTION
' ========================================================================================
' ========================================================================================
' UI4 Release()
' Releases our class if there is only a reference to him and decrements the reference counter.
' ========================================================================================
FUNCTION IMAPIProgress_Release (BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR) AS DWORD
LOCAL pVtblAddr AS DWORD
IF @@pIMAPIProgress.cRef = 1 THEN
pVtblAddr = @@pIMAPIProgress.pVtblAddr
IF ISTRUE HeapFree(GetProcessHeap(), 0, BYVAL pVtblAddr) THEN
FUNCTION = 0
EXIT FUNCTION
ELSE
FUNCTION = @@pIMAPIProgress.cRef
EXIT FUNCTION
END IF
END IF
DECR @@pIMAPIProgress.cRef
FUNCTION = @@pIMAPIProgress.cRef
END FUNCTION
' ========================================================================================
' ========================================================================================
' IMAPIProgress::Progress
' The IMAPIProgress::Progress method updates the progress indicator with a display of the
' progress as it is made toward completion of the operation.
' ========================================================================================
FUNCTION IMAPIProgress_Progress ( _
BYVAL BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR _
, BYVAL ulValue AS DWORD _
, BYVAL ulCount AS DWORD _
, BYVAL ulTotal AS DWORD _
) AS LONG
' *** Put your code here ***
' Return Values
' %S_OK The progress indicator was successfully updated.
END FUNCTION
' ========================================================================================
' ========================================================================================
' IMAPIProgress::GetFlags
' The IMAPIProgress::GetFlags method returns flag settings from the progress object for
' the level of operation on which progress information is calculated.
' ========================================================================================
FUNCTION IMAPIProgress_GetFlags ( _
BYVAL BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR _
, BYREF lpulFlags AS DWORD _
) AS LONG
' *** Put your code here ***
' Return Values
' %S_OK The flags value was returned successfully.
END FUNCTION
' ========================================================================================
' ========================================================================================
' IMAPIProgress::GetMax
' The IMAPIProgress::GetMax method returns the maximum number of items in the operation
' for which progress information is displayed.
' ========================================================================================
FUNCTION IMAPIProgress_GetMax ( _
BYVAL BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR _
, BYREF lpulMax AS DWORD _
) AS LONG
' *** Put your code here ***
' Return Values
' %S_OK The maximum number of items in the operation has been retrieved.
END FUNCTION
' ========================================================================================
' ========================================================================================
' IMAPIProgress::GetMin
' The IMAPIProgress::GetMin method returns the minimum value in IMAPIProgress::SetLimits
' for which progress information is displayed.
' ========================================================================================
FUNCTION IMAPIProgress_GetMin ( _
BYVAL BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR _
, BYREF lpulMin AS DWORD _
) AS LONG
' *** Put your code here ***
' Return Values
' %S_OK The minimum number of items in the operation has been retrieved.
END FUNCTION
' ========================================================================================
' ========================================================================================
' IMAPIProgress::SetLimits
' The IMAPIProgress::SetLimits method sets the lower limit for the number of items
' operated on, the maximum number of items operated on, and the flags that control how progress information is calculated for the operation in question.
' ========================================================================================
FUNCTION IMAPIProgress_SetLimits ( _
BYVAL BYVAL pIMAPIProgress AS IMAPIProgress_IUnknownVtbl PTR _
, BYREF lpulMin AS DWORD _
, BYREF lpulMax AS DWORD _
, BYREF lpulFlags 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:35 +0200