' ########################################################################################
' Microsoft Windows
' File: DispEx.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_DispEx_PBI)
#DEFINE PBX_DispEx_PBI
%EQUATE `DISEXP_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
'//---------------------------------------------------------------------------=
'// IDispatchEx Interfaces.
'//
#INCLUDE ONCE "Legacy/System/ServProv.inc"
#IF NOT %DEF(%NO_DISPATCHEX_GUIDS)
$IID_IDispatchEx = GUID$("{A6EF9860-C720-11D0-9337-00A0C90DCAA9}")
$IID_IDispError = GUID$("{A6EF9861-C720-11D0-9337-00A0C90DCAA9}")
$IID_IVariantChangeType = GUID$("{A6EF9862-C720-11D0-9337-00A0C90DCAA9}")
$SID_VariantConversion = GUID$("{1F101481-BCCD-11D0-9336-00A0C90DCAA9}")
$SID_GetCaller = GUID$("{4717CC40-BCB9-11D0-9336-00A0C90DCAA9}")
$SID_ProvideRuntimeContext = GUID$("{74A5040C-DD0C-48f0-AC85-194C3259180A}")
$IID_IProvideRuntimeContext = GUID$("{10E2414A-EC59-49d2-BC51-5ADD2C36FEBC}")
$IID_IObjectIdentity = GUID$("{CA04B7E6-0D21-11D1-8CC5-00C04FC2B085}")
'#define SID_GetScriptSite IID_IActiveScriptSite
$SID_GetScriptSite = GUID$("{DB01A1E3-A42B-11cf-8F20-00805F2CD064}")
#ENDIF ' // _NO_DISPATCHEX_GUIDS
#IF NOT %DEF(%NO_DISPATCHEX_CONSTS)
'// Input flags for GetDispID
%EQUATE `fdexNameCaseSensitive = &H00000001
%EQUATE `fdexNameEnsure = &H00000002
%EQUATE `fdexNameImplicit = &H00000004
%EQUATE `fdexNameCaseInsensitive = &H00000008
%EQUATE `fdexNameInternal = &H00000010
%EQUATE `fdexNameNoDynamicProperties = &H00000020
'// Output flags for GetMemberProperties
%EQUATE `fdexPropCanGet = &H00000001
%EQUATE `fdexPropCannotGet = &H00000002
%EQUATE `fdexPropCanPut = &H00000004
%EQUATE `fdexPropCannotPut = &H00000008
%EQUATE `fdexPropCanPutRef = &H00000010
%EQUATE `fdexPropCannotPutRef = &H00000020
%EQUATE `fdexPropNoSideEffects = &H00000040
%EQUATE `fdexPropDynamicType = &H00000080
%EQUATE `fdexPropCanCall = &H00000100
%EQUATE `fdexPropCannotCall = &H00000200
%EQUATE `fdexPropCanConstruct = &H00000400
%EQUATE `fdexPropCannotConstruct = &H00000800
%EQUATE `fdexPropCanSourceEvents = &H00001000
%EQUATE `fdexPropCannotSourceEvents = &H00002000
%EQUATE `grfdexPropCanAll = %fdexPropCanGet OR %fdexPropCanPut OR %fdexPropCanPutRef OR %fdexPropCanCall OR %fdexPropCanConstruct OR %fdexPropCanSourceEvents
%EQUATE `grfdexPropCannotAll = %fdexPropCannotGet OR %fdexPropCannotPut OR %fdexPropCannotPutRef OR %fdexPropCannotCall OR %fdexPropCannotConstruct OR %fdexPropCannotSourceEvents
%EQUATE `grfdexPropExtraAll = %fdexPropNoSideEffects OR %fdexPropDynamicType
%EQUATE `grfdexPropAll = %grfdexPropCanAll OR %grfdexPropCannotAll OR %grfdexPropExtraAll
'// Input flags for GetNextDispID
%EQUATE `fdexEnumDefault = &H00000001
%EQUATE `fdexEnumAll = &H00000002
'// Additional flags for Invoke - when object member is used as a constructor.
%EQUATE `DISPATCH_CONSTRUCT = &H4000
'// Standard DISPIDs
%EQUATE `DISPID_THIS = -613
%EQUATE `DISPID_STARTENUM = %DISPID_UNKNOWN
#ENDIF ' //_NO_DISPATCHEX_CONSTS
' ########################################################################################
' IDispatchEx interface
' IID = A6EF9860-C720-11D0-9337-00A0C90DCAA9
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IDispatchEx_INTERFACE_DEFINED)
 %IDispatchEx_INTERFACE_DEFINED = 1
$IID_IDispatchEx = GUID$("{A6EF9860-C720-11D0-9337-00A0C90DCAA9}")
INTERFACE IDispatchEx $IID_IDispatchEx
 INHERIT IDispatch
 ' =====================================================================================
 METHOD GetDispID ( ' VTable offset = 28
 BYVAL bstrName AS WSTRING
 , BYVAL grfdex AS DWORD
 , BYREF pid AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD InvokeEx ( ' VTable offset = 32
 BYVAL id AS LONG
 , BYVAL lcid AS DWORD
 , BYVAL wFlags AS WORD
 , BYREF pdp AS DISPPARAMS
 , BYREF pvarRes AS VARIANT
 , BYREF pei AS EXCEPINFO
 , BYVAL pspCaller AS IServiceProvider
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteMemberByName ( ' VTable offset = 36
 BYVAL bstrName AS WSTRING
 , BYVAL grfdex AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteMemberByDispID ( ' VTable offset = 40
 BYVAL id AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetMemberProperties ( ' VTable offset = 44
 BYVAL id AS LONG
 , BYVAL grfdexFetch AS DWORD
 , BYREF pgrfdex AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMemberName ( ' VTable offset = 48
 BYVAL id AS LONG
 , BYREF pbstrName AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetNextDispID ( ' VTable offset = 52
 BYVAL grfdex AS DWORD
 , BYVAL id AS LONG
 , BYREF pid AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetNameSpaceParent ( ' VTable offset = 56
 BYREF ppunk AS IUnknown
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IDispatchEx_INTERFACE_DEFINED__ */
' ########################################################################################
' IDispError interface
' IID = A6EF9861-C720-11D0-9337-00A0C90DCAA9
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IDispError_INTERFACE_DEFINED)
 %IDispError_INTERFACE_DEFINED = 1
$IID_IDispError = GUID$("{A6EF9861-C720-11D0-9337-00A0C90DCAA9}")
INTERFACE IDispError $IID_IDispError
 INHERIT IUnknown
 ' =====================================================================================
 METHOD QueryErrorInfo ( ' VTable offset = 12
 BYREF guidErrorType AS GUID
 , BYREF ppde AS IDispError
 ) AS LONG
 ' =====================================================================================
 METHOD GetNext ( ' VTable offset = 16
 BYREF ppde AS IDispError
 ) AS LONG
 ' =====================================================================================
 METHOD GetHresult ( ' VTable offset = 20
 BYREF phr AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetSource ( ' VTable offset = 24
 BYREF pbstrSource AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetHelpInfo ( ' VTable offset = 28
 BYREF pbstrSource AS WSTRING
 , BYREF pdwContext AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetDescription ( ' VTable offset = 32
 BYREF pbstrDescription AS WSTRING
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IDispError_INTERFACE_DEFINED__ */
' ########################################################################################
' IVariantChangeType interface
' IID = A6EF9862-C720-11D0-9337-00A0C90DCAA9
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IVariantChangeType_INTERFACE_DEFINED)
 %IVariantChangeType_INTERFACE_DEFINED = 1
$IID_IVariantChangeType = GUID$("{A6EF9862-C720-11D0-9337-00A0C90DCAA9}")
INTERFACE IVariantChangeType $IID_IVariantChangeType
 INHERIT IUnknown
 ' =====================================================================================
 METHOD ChangeType ( ' VTable offset = 12
 BYREF pvarDst AS VARIANT
 , BYREF pvarSrc AS VARIANT
 , BYVAL lcid AS DWORD
 , BYVAL vtNew AS WORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IVariantChangeType_INTERFACE_DEFINED__ */
' ########################################################################################
' IObjectIdentity interface
' IID = CA04B7E6-0D21-11D1-8CC5-00C04FC2B085
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IObjectIdentity_INTERFACE_DEFINED)
 %IObjectIdentity_INTERFACE_DEFINED = 1
$IID_IObjectIdentity = GUID$("{CA04B7E6-0D21-11D1-8CC5-00C04FC2B085}")
INTERFACE IObjectIdentity $IID_IObjectIdentity
 INHERIT IUnknown
 ' =====================================================================================
 METHOD IsEqualObject ( ' VTable offset = 12
 BYVAL punk AS IUnknown
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IObjectIdentity_INTERFACE_DEFINED__ */
' ########################################################################################
' IProvideRuntimeContext interface
' IID = 10E2414A-EC59-49d2-BC51-5ADD2C36FEBC
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IProvideRuntimeContext_INTERFACE_DEFINED)
 %IProvideRuntimeContext_INTERFACE_DEFINED = 1
$IID_IProvideRuntimeContext = GUID$("{10E2414A-EC59-49d2-BC51-5ADD2C36FEBC}")
INTERFACE IProvideRuntimeContext $IID_IProvideRuntimeContext
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetCurrentSourceContext ( ' VTable offset = 12
 BYREF pdwContext AS DWORD
 , BYREF pfExecutingGlobalCode AS INTEGER
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IProvideRuntimeContext_INTERFACE_DEFINED__ */
#ENDIF
