Home COM GDI+ WebBrowser Data Access

IRowPositionChange Interface

 

IID_IRowPositionChange

{0997A571-126E-11D0-9F8A-00A0C9A0631E}

 

 

IRowPositionChange is implemented by consumers that require notification about changes to the current row position.

 

Documentation: IRowPositionChange

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IRowPositionChange Method

Description

OnRowPositionChange

Notifies the consumer of a row position object of a change to the current row position.

 

IRowPositionChange interface implementation

 


$IID_IRowPositionChange = GUID$("{0997A571-126E-11D0-9F8A-00A0C9A0631E}")

' ****************************************************************************************
' IRowPositionChange interface
' ****************************************************************************************
TYPE IRowPositionChangeVtbl
   ' IUnknown methods
   pQueryInterface          AS DWORD          ' // QueryInterface method
   pAddRef                  AS DWORD          ' // AddRef method
   pRelease                 AS DWORD          ' // Release method
   ' IRowPositionChange members
   pOnRowPositionChange     AS DWORD          ' // OnRowPositionChange method
   ' Custom data
   pVtblAddr                AS DWORD          ' // Address of the virtual table
   cRef                     AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the IRowPositionChange Virtual Table
' Returns a cookie that is a pointer to a IRowPositionChangeVtbl structure.
' ****************************************************************************************
FUNCTION IRowPositionChange_BuildVtbl () AS DWORD

   LOCAL pVtbl AS IRowPositionChangeVtbl PTR
   LOCAL pUnk AS IRowPositionChangeVtbl PTR

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

   @pVtbl.pQueryInterface          = CODEPTR(IRowPositionChange_QueryInterface)
   @pVtbl.pAddRef                  = CODEPTR(IRowPositionChange_AddRef)
   @pVtbl.pRelease                 = CODEPTR(IRowPositionChange_Release)

   @pVtbl.pOnRowPositionChange     = CODEPTR(IRowPositionChange_OnRowPositionChange)

   @pVtbl.pVtblAddr                = pVtbl
   @pVtbl.cRef                     = 1

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

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IRowPositionChange_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IRowPositionChange_QueryInterface (BYVAL pCookie AS IRowPositionChangeVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
   IF riid = $IID_IRowPositionChange THEN
      ppvObj = pCookie
      INCR @@pCookie.cRef
      FUNCTION = %S_OK
   ELSE
      FUNCTION = %E_NOINTERFACE
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IRowPositionChange_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IRowPositionChange_AddRef (BYVAL pCookie AS IRowPositionChangeVtbl PTR) AS DWORD
   INCR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IRowPositionChange_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IRowPositionChange_Release (BYVAL pCookie AS IRowPositionChangeVtbl PTR) AS DWORD
   DECR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
   IF @@pCookie.cRef = 0 THEN
      IF ISTRUE @@pCookie.pVtblAddr THEN
         HeapFree(GetProcessHeap(), 0, BYVAL @@pCookie.pVtblAddr)
      END IF
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Notifies the consumer of a row position object of a change to the current row position.
' ****************************************************************************************
FUNCTION IRowPositionChange_OnRowPositionChange (BYVAL pCookie AS IRowPositionChangeVtbl PTR, BYVAL eReason AS DWORD, BYVAL ePhase AS DWORD, BYVAL fCantDeny AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Wednesday, 15 February 2006 23:37:15 +0100