|
|
|
ICodeInstall Interface |
|
IID_ICodeInstall |
{79EAC9D1-BAF9-11CE-8C82-00AA004BA90B} |
|
Callback interface for problems with application installations or file downloads.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IWindowForBindingUI Method |
Description |
|
GetWindow |
Retrieves a handle to a window to present information in the user interface during a bind operation. |
|
ICodeInstall Method |
Description |
|
OnCodeInstallProblem |
The ICodeInstall::OnCodeInstallProblem method returns a value based on the status passed in. The return value indicates whether to abort the application installation or file download. |
|
ICodeInstall interface implementation |
$IID_ICodeInstall = GUID$("{79EAC9D1-BAF9-11CE-8C82-00AA004BA90B}")
' ****************************************************************************************
' ICodeInstall interface virtual table
' ****************************************************************************************
TYPE ICodeInstallVtbl
' IUnknown methods
pQueryInterface AS DWORD ' // QueryInterface method
pAddRef AS DWORD ' // AddRef method
pRelease AS DWORD ' // Release method
' IWindowForBindingUI method
pGetWindow AS DWORD ' // GetWindow method
' ICodeInstall method
pOnCodeInstallProblem AS DWORD ' // OnCodeInstallProblem method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the ICodeInstall Virtual Table
' Returns a cookie that is a pointer to a ICodeInstallVtbl structure.
' ****************************************************************************************
FUNCTION ICodeInstall_BuildVtbl () AS DWORD
LOCAL pVtbl AS ICodeInstallVtbl PTR
LOCAL pUnk AS ICodeInstallVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(ICodeInstall_QueryInterface)
@pVtbl.pAddRef = CODEPTR(ICodeInstall_AddRef)
@pVtbl.pRelease = CODEPTR(ICodeInstall_Release)
@pVtbl.pGetWindow = CODEPTR(ICodeInstall_GetWindow)
@pVtbl.pOnCodeInstallProblem = CODEPTR(ICodeInstall_OnCodeInstallProblem)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' ICodeInstall_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION ICodeInstall_QueryInterface (BYVAL pCookie AS ICodeInstallVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_ICodeInstall THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' ICodeInstall_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION ICodeInstall_AddRef (BYVAL pCookie AS ICodeInstallVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' ICodeInstall_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION ICodeInstall_Release (BYVAL pCookie AS ICodeInstallVtbl 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
' ****************************************************************************************
' ****************************************************************************************
' Retrieves a handle to a window to present information in the user interface during a
' bind operation.
' ****************************************************************************************
FUNCTION ICodeInstall_GetWindow (BYVAL pCookie AS ICodeInstallVtbl PTR, BYREF rguidReason AS GUID, BYREF phwnd AS DWORD) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' The ICodeInstall::OnCodeInstallProblem method returns a value based on the status
' passed in. The return value indicates whether to abort the application installation or
' file download.
' ****************************************************************************************
FUNCTION ICodeInstall_OnCodeInstallProblem (BYVAL pCookie AS ICodeInstallVtbl PTR, BYVAL ulStatusCode AS DWORD, BYVAL szDestination AS DWORD, BYVAL szSource AS DWORD, BYVAL dwReserved AS DWORD) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_ABORT
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 19:42:29 +0200