INIT

 (Available in 01 TS COM - TS_COM_DelegateIDispatchAuto)

Purpose

Create a 'TS_DelegateIDispatchAuto' instance

Syntax

oDelegateIDispatchAuto:=TS_DelegateIDispatchAuto{ NIL, "Outlook.Application" }

Arguments

uoOwner
NIL, OBJECT
uocpXUnknownID
OBJECT, STRING, POINTER(GUID)
uloSelfDestruct
NIL, LOGIC, OBJECT
ulXUnknownIDIsInterface
NIL, LOGIC(If true then uocpXUnknownID is a interface pointer )

Description

This class is equivalent to the VO 'OLEAutoObject' class. It provodes a wrapper for the 'IDispatch' COM interface that is dynamicly allocated and will be collected by the GC when it looses scope.

Source

METHOD INIT( uoOwner, uocpXUnknownID, uloSelfDestruct, ulXUnknownIDIsInterface )  ; ...
...CLASS TS_DelegateIDispatchAuto
   TSTrace Enter CREATE
   DO CASE
   CASE IsLogic( ulXUnknownIDIsInterface ) .AND. ulXUnknownIDIsInterface
      SELF:_DelegateIDispatch:=TS_DelegateIDispatch{ uoOwner,  ; ...
     ... uocpXUnknownID, uloSelfDestruct, ulXUnknownIDIsInterface }
   CASE TS_IsInstanceOf( uocpXUnknownID, #TS_DelegateIDispatch )
      SELF:_DelegateIDispatch:=uocpXUnknownID
   CASE TS_IsInstanceOf( uocpXUnknownID, #TS_DelegateIDispatchAuto )
      SELF:_DelegateIDispatch:=uocpXUnknownID:DelegateIDispatch
   OTHERWISE
      SELF:_DelegateIDispatch:=TS_DelegateIDispatch{ uoOwner,  ; ...
     ... uocpXUnknownID, uloSelfDestruct, ulXUnknownIDIsInterface }
   END
   SELF:RegisterAxit( )
   TStrace Leave
RETURN SELF