Home COM GDI+ WebBrowser Data Access

ITravelLogStg  Interface

 

SID_STravelLogCursor

{7EBFDD80-AD18-11D3-A4C5-00C04F72D6B8}

IID_ITravelLogStg

{7EBFDD80-AD18-11D3-A4C5-00C04F72D6B8}

 

 

This interface provides methods which create, enumerate, and remove entries in the travel log.

 

Note  SID_STravelLogCursor is defined in tlogstg.h as IID_ITravelLogStg.

 

#define SID_STravelLogCursor IID_ITravelLogStg

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ITravelLogStg Methods

Description

CreateEntry

Inserts a new entry in the travel log.

TravelTo

Navigates to an entry.

EnumEntries

Creates an enumerator for travel log entries.

FindEntries

Not currently implemented.

GetCount

Specifies the number of entries in the travel log.

RemoveEntry

Deletes an entry from the travel log.

GetRelativeEntry

Gets an entry from the travel log.

 

GetTitle

 

FUNCTION ITravelLogStg_CreateEntry ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL strUrl AS STRING _
, BYVAL strTitle AS STRING _
, BYVAL ptleRelativeTo AS DWORD _
, BYVAL fPrepend AS LONG _
, BYREF pptle AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG

  strUrl = UCODE$(strUrl) & $NUL
  strTitle = UCODE$(strTitle) & $NUL
  CALL DWORD @@pthis[3] USING ITravelLogStg_CreateEntry (pthis, strUrl, strTitle, ptleRelativeTo, fPrepend, pptle) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

TravelTo

 

FUNCTION ITravelLogStg_TravelTo ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL
ptle AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING ITravelLogStg_TravelTo (pthis,
ptle) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

EnumEntries

 

FUNCTION ITravelLogStg_EnumEntries ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL flags AS LONG _
, BYREF ppenum AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING ITravelLogStg_EnumEntries (pthis, flags, ppenum) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

FindEntries

 

FUNCTION ITravelLogStg_FindEntries ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL flags AS LONG _
, BYVAL strUrl AS STRING _
, BYREF ppenum AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG

  strUrl = UCODE$(strUrl) & $NUL
  CALL DWORD @@pthis[6] USING ITravelLogStg_FindEntries (pthis, flags, strUrl, ppenum) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetCount

 

FUNCTION ITravelLogStg_GetCount ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL flags AS LONG _
, BYREF pcEntries AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING ITravelLogStg_GetCount (pthis, flags, pcEntries) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

RemoveEntry

 

FUNCTION ITravelLogStg_RemoveEntry ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL ptle AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING ITravelLogStg_RemoveEntry (pthis, ptle) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetRelativeEntry

 

FUNCTION ITravelLogStg_GetRelativeEntry ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL iOffset AS LONG _
, BYREF ptle AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING ITravelLogStg_GetRelativeEntry (pthis, iOffset, ptle) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Example

 

 

The following code uses ItravelLogStg to delete entries in the session history of an embedded WebBrowser control. It uses the wrapper functions of my library TB_WEBBR.
 

 


' ****************************************************************************************
' NavigateComplete2
' Member identifier: &H000000FC (252)
' Fires after a navigation to a link is completed on either a window or frameSet element.
' ****************************************************************************************
SUB DWebBrowserEvents2_NavigateComplete2 (BYVAL pCookie AS DWebBrowserEvents2_IDispatchVtbl PTR, BYREF pdispparams AS DISPPARAMS)

'  Retrieve the IDispatch of the control that has fired the event.
   LOCAL pthis AS DWORD : pthis = @@pCookie.pthis
'  Variants to access the parameters.
   LOCAL pv AS VARIANT PTR : pv = pdispparams.VariantArgs
   LOCAL pvapi AS VARIANTAPI PTR : pvapi = pv
'  Get the values of the parameters.
   LOCAL pDisp AS DWORD : pDisp = VARIANT#(@pv[1])
   LOCAL URL AS VARIANT : URL = @pv[0]

'  ======================================================================================
'  If the url is "http://www.powerbasic.com/support/forums/Ultimate.cgi" delete all
'  the entries prior to it in the Travel Log Storage.
'  ======================================================================================
   LOCAL hr AS LONG                     ' // HRESULT
   LOCAL pISP AS DWORD                  ' // IServiceProvider interface
   LOCAL pITLStg AS DWORD               ' // ITravelLogStg interface
   LOCAL pITLEntry AS DWORD             ' // ITravelLogEntry interface
   LOCAL IID_IServiceProvider AS GUID   ' // IServiceProvider IID
   LOCAL IID_ITravelLogStg AS GUID      ' // ITravelLogStg IID
   LOCAL pTLEnum AS DWORD               ' // ITravelLogEntry enumerator
   LOCAL cEltFetched AS DWORD           ' // Number of entries fetched
   LOCAL strCurrentURL AS STRING        ' // Current URL

   ' Retrieve a reference to the IServiceProvider interface
   IID_IServiceProvider = GUID$("{6D5140C1-7436-11CE-8034-00AA006009FA}")
   IID_ITravelLogStg = GUID$("{7EBFDD80-AD18-11D3-A4C5-00C04F72D6B8}")
   pISP = WbQueryInterface(pthis, IID_IServiceProvider)

   IF ISTRUE pISP THEN
      ' Retrieve a reference to the ITravelLogStg interface
      pITLStg = WbIServiceProvider_QueryService(pISP, IID_ITravelLogStg, IID_ITravelLogStg)
      IF ISTRUE pITLStg THEN
         ' Get the current entry url
         pITLEntry = ITravelLogStg_GetRelativeEntry(pITLStg, 0)
         IF ISTRUE pITLEntry THEN
            strCurrentURL = ITravelLogEntry_GetUrl(pITLEntry)
            WbRelease pITLEntry
         END IF
         IF strCurrentURL = "http://www.powerbasic.com/support/forums/Ultimate.cgi" THEN
            ' Retrieve an enumerator that includes all entries before the current
            pTLEnum = ITravelLogStg_EnumEntries(pITLStg, %TLEF_RELATIVE_BACK)
            IF ISTRUE pTLEnum THEN
               DO
                  ' Remove all the entries
                  cEltFetched = IEnumTravelLogEntry_Next(pTLEnum, 1, VARPTR(pITLEntry))
                  IF cEltFetched = 0 THEN EXIT DO
                  IF ISTRUE pITLEntry THEN
                     ITravelLogStg_RemoveEntry(pITLStg, pITLEntry)
                     WbRelease pITLEntry
                     IF WbError THEN EXIT DO
                  END IF
               LOOP
               ' Release the enumerator
               WbRelease pTLEnum
            END IF
         END IF
         WbRelease pITLStg
      END IF
      WbRelease pISP
   END IF

END SUB
' ****************************************************************************************
 

 

Page last updated on Monday, 03 April 2006 20:05:45 +0200