|
|
|
IHlinkSite Interface |
|
IID_IHlinkSite |
{79EAC9C2-BAF9-11CE-8C82-00AA004BA90B} |
|
This interface
provides methods for a hyperlink to retrieve the moniker or the interface on
its hyperlink container. The navigation process that resolves a hyperlink
uses this information to handle internal (within the same container) and
external (to a different container) hyperlink references. |
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IHlinkSite Methods |
Description |
|
QueryService |
Sets the browse context of the hyperlink frame. |
|
GetMoniker |
Retrieves the browse context of the hyperlink frame. |
|
ReadyToNavigate |
Navigates to the target hyperlink. |
|
OnNavigationComplete |
Notifies the hyperlink frame about a hyperlink navigation. |
|
QueryService |
|
FUNCTION
IHlinkSite_QueryService ( _ |
|
GetMoniker |
|
FUNCTION
IHlinkSite_GetMoniker ( _
|
|
ReadyToNavigate |
|
FUNCTION
IHlinkSite_ReadyToNavigate ( _
CALL DWORD @@pthis[5]
USING IHlinkSite_ReadyToNavigate (pthis, dwSiteData, dwReserved)
TO HRESULT |
|
OnNavigationComplete |
|
FUNCTION
IHlinkSite_OnNavigationComplete ( _ CALL
DWORD @@pthis[6] USING
IHlinkSite_OnNavigationComplete (pthis, dwSiteData, dwreserved, hrError,
pwzError) TO HRESULT |
|
IHLinkSite interface implementation |
$IID_IHlinkSite = GUID$("{79EAC9C2-BAF9-11CE-8C82-00AA004BA90B}")
' ****************************************************************************************
' IHlinkSite interface
' ****************************************************************************************
TYPE IHlinkSiteVtbl
' IUnknown methods
pQueryInterface AS DWORD ' // QueryInterface method
pAddRef AS DWORD ' // AddRef method
pRelease AS DWORD ' // Release method
' IHlinkSite members
pQueryService AS DWORD ' // QueryService method
pGetMoniker AS DWORD ' // GetMoniker method
pReadyToNavigate AS DWORD ' // ReadyToNavigate method
pOnNavigationComplete AS DWORD ' // OnNavigationComplete method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IHlinkSite Virtual Table
' Returns a cookie that is a pointer to a IHlinkSiteVtbl structure.
' ****************************************************************************************
FUNCTION IHlinkSite_BuildVtbl () AS DWORD
LOCAL pVtbl AS IHlinkSiteVtbl PTR
LOCAL pUnk AS IHlinkSiteVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IHlinkSite_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IHlinkSite_AddRef)
@pVtbl.pRelease = CODEPTR(IHlinkSite_Release)
@pVtbl.pQueryService = CODEPTR(IHlinkSite_QueryService)
@pVtbl.pGetMoniker = CODEPTR(IHlinkSite_GetMoniker)
@pVtbl.pReadyToNavigate = CODEPTR(IHlinkSite_ReadyToNavigate)
@pVtbl.pOnNavigationComplete = CODEPTR(IHlinkSite_OnNavigationComplete)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHlinkSite_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IHlinkSite_QueryInterface (BYVAL pCookie AS IHlinkSiteVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IHlinkSite THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHlinkSite_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IHlinkSite_AddRef (BYVAL pCookie AS IHlinkSiteVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHlinkSite_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IHlinkSite_Release (BYVAL pCookie AS IHlinkSiteVtbl 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
' ****************************************************************************************
' ****************************************************************************************
' Sets the browse context of the hyperlink frame.
' ****************************************************************************************
FUNCTION IHlinkSite_QueryService (BYVAL pCookie AS IHlinkSiteVtbl PTR, BYVAL dwSiteData AS DWORD, BYREF guidService AS GUID, BYREF riid AS GUID, BYREF ppiunk AS DWORD) AS LONG
' Put your code here
' FUNCTION = %S_OK
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Retrieves the browse context of the hyperlink frame.
' ****************************************************************************************
FUNCTION IHlinkSite_GetMoniker (BYVAL pCookie AS IHlinkSiteVtbl PTR, BYVAL dwSiteData AS DWORD, BYVAL dwAssign AS DWORD, BYVAL dwWhich AS DWORD, BYREF ppimk AS DWORD) AS LONG
' Put your code here
' FUNCTION = %S_OK
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Navigates to the target hyperlink.
' ****************************************************************************************
FUNCTION IHlinkSite_ReadyToNavigate (BYVAL pCookie AS IHlinkSiteVtbl PTR, BYVAL dwSiteData AS DWORD, BYVAL dwReserved AS DWORD) AS LONG
' Put your code here
' FUNCTION = %S_OK
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Notifies the hyperlink frame about a hyperlink navigation.
' ****************************************************************************************
FUNCTION IHlinkSite_OnNavigationComplete (BYVAL pCookie AS IHlinkSiteVtbl PTR, BYVAL dwSiteData AS DWORD, BYVAL dwreserved AS DWORD, BYVAL hrError AS DWORD, BYVAL pwzError AS DWORD) AS LONG
' Put your code here
' FUNCTION = %S_OK
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 19:54:16 +0200