|
|
|
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 ( _
strUrl = UCODE$(strUrl) &
$NUL |
|
TravelTo |
|
FUNCTION
ITravelLogStg_TravelTo ( _
|
|
EnumEntries |
|
FUNCTION
ITravelLogStg_EnumEntries ( _ |
|
FindEntries |
|
FUNCTION
ITravelLogStg_FindEntries ( _
strUrl = UCODE$(strUrl) &
$NUL |
|
GetCount |
|
FUNCTION
ITravelLogStg_GetCount ( _ |
|
RemoveEntry |
|
FUNCTION
ITravelLogStg_RemoveEntry ( _ |
|
GetRelativeEntry |
|
FUNCTION
ITravelLogStg_GetRelativeEntry ( _ |
|
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