AIThis
(Available in 01 TS COM - TS_COM_DelegateIUnknown)
Purpose
Get a static 'This' COM interface pointer.
Syntax
oAIUnknown:=oDelegateIUnknown:AIThis
Description
Get a static 'This' COM interface pointer. The object ( interface pointer ) returned by this property must be released by using the 'Release()' method of the returend object. Normaly this property is used when a interface pointer must be passed to an interface in the form of a parameter.
Returns
OBJECT(InterfacePointer), Refereing to a static COM interface
Example
oResultAIUnknown:=oInterfaceSafe:AIThis
IF oResultAIUnknown<>NULL_OBJECT
OBJECT( PTR( _CAST, poAIUnknown ) ):=oResultAIUnknown
lRetVal:=TRUE
ELSE
TSTrace Warning "oResultAIUnknown:=oParamDIUnknown:AIThis==NULL_OBJECT"
OBJECT( PTR( _CAST, poAIUnknown ) ):=NULL_OBJECT
LONG( phResult ):=E_FAIL
lRetVal:=FALSE
END
Source
ACCESS AIThis AS TS_AbstractIUnknown PASCAL CLASS TS_DelegateIUnknown
LOCAL oAIUnknown AS TS_AbstractIUnknown
TSTrace Enter
IF SELF:FInit
oAIUnknown:=SELF:_AIUnknown
IF oAIUnknown<>NULL_OBJECT
#IFDEF TS_TRACETIMED_ENABLE
_TS_TraceTimedEnter( TS_TT_SYM_EXTERNAL, TS_TT_SYM_IUNKNOWN, #AddRef ; ...
... )
#ENDIF
oAIUnknown:AddRef( )
#IFDEF TS_TRACETIMED_ENABLE
_TS_TraceTimedLeave( TS_TT_SYM_EXTERNAL, TS_TT_SYM_IUNKNOWN, #AddRef ; ...
... )
#ENDIF
ELSE
TSTrace Fatal