EventHandlerAdd
(Available in 01 TS COM - TS_COM_DelegateIUnknown)
Purpose
Install a installed event handler.
Syntax
? oDIUnknown:EventHandlerAdd( symDelegateISink )
Arguments
Description
Install a installed event handler. The application provides the name of the event handler class to instantiate, when the event handler is instantiated successfuly the method returns a reference to the handler created.
Returns
OBJECT, Instantiated event handler class
Example
CLASS TS_HOutlookApplicationEvents INHERIT TS_DelegateISink
ACCESS IID AS _WinGUID PTR PASCAL CLASS TS_HOutlookApplicationEvents
LOCAL STATIC pstruIID AS _WinGUID
IF pstruIID==NULL_PTR
pstruIID:=MemAlloc( _SIZEOF( _WinGUID ) )
IF pstruIID<>NULL_PTR
pstruIID.Data1:=0x0006304EU
pstruIID.Data2:=0x0000
pstruIID.Data3:=0x0000
pstruIID.Data4[ 1 ]:=0xC0
pstruIID.Data4[ 2 ]:=0x00
pstruIID.Data4[ 3 ]:=0x00
pstruIID.Data4[ 4 ]:=0x00
pstruIID.Data4[ 5 ]:=0x00
pstruIID.Data4[ 6 ]:=0x00
pstruIID.Data4[ 7 ]:=0x00
pstruIID.Data4[ 8 ]:=0x46
ELSE
TSTrace Fatal "Can not allocate memory for GUID"
pstruIID:=TS_GUID_NULL( )
END
END
RETURN pstruIID