GetTypeInfo

 (Available in 01 TS COM - TS_COM_IDispatch)

Purpose

Get the 'TypeInfo' interface

Syntax

hResult:=oSomeIObject:GetTypeInfo( 0, TS_Locale( ), @oAITypeInfo )

Arguments

iTypeInfo
INT
dwLCID
DWORD
poAITypeInfo
TS_AbstractITypeInfo PTR

Description

Get the 'TypeInfo' interface

MSDN ==== IDispatch::GetTypeInfo Retrieves the type information for an object, which can then be used to get the type information for an interface.

HRESULT GetTypeInfo( unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo );

Parameters iTInfo = The type information to return. Pass 0 to retrieve type information for the IDispatch implementation. lcid = The locale identifier for the type information. An object may be able to return different type information for different languages. This is important for classes that support localized member names. For classes that do not support localized member names, this parameter can be ignored. ppTInfo = Receives a pointer to the requested type information object.

Return Value The return value obtained from the returned HRESULT is one of the following:

Return value Meaning S_OK = Success; the type information element exists. DISP_E_BADINDEX = Failure; iTInfo argument was not 0.

Returns

hResult

Example

LOCAL oAITypeInfo AS TS_AbstractITypeInfo
hResult:=oSomeIObject:GetTypeInfo( 0, TS_Locale( ), @oAITypeInfo )
IF TS_Succeeded( hResult )
// Start using the 'oAITypeInfo'
   oAITypeInfo:Release( )
END

Source

METHOD GetTypeInfo( iTypeInfo AS INT, dwLCID AS DWORD, poAITypeInfo AS TS_AbstractITypeInfo  ; ...
...PTR ) AS LONG PASCAL CLASS TS_IDispatch
LOCAL oAIOuterDispatch AS TS_AbstractIDispatch
LOCAL hResult AS LONG
   TSTrace Enter
   TSTrace ToDo NB "Aggregation needs to be tested"
   DO CASE
   CASE !SELF:IsValidObject
      TSTrace Warning "!SELF:IsValidObject"
      IF poAITypeInfo<>NULL_PTR
         OBJECT( PTR( _CAST, poAITypeInfo ) ):=NULL_OBJECT
      ELSE
         TSTrace Warning "poAITypeInfo==NULL_PTR"
      END
      hResult:=DISP_E_BADINDEX
   CASE LOGIC( _CAST, SELF:_OuterAIUnknown )
      #IFDEF TS_TRACETIMED_ENABLE
         _TS_TraceTimedEnter( TS_TT_SYM_EXTERNAL, TS_TT_SYM_OUTERAIUNKNOWN, #QueryInterface  ; ...
        ... )
      #ENDIF
      hResult:=SELF:_OuterAIUnknown:QueryInterface(  ; ...
     ... TS_GUID_IDispatch( ), @oAIOuterDispatch )
      #IFDEF TS_TRACETIMED_ENABLE
         _TS_TraceTimedLeave( TS_TT_SYM_EXTERNAL, TS_TT_SYM_OUTERAIUNKNOWN, #QueryInterface  ; ...
        ... )
      #ENDIF
      IF TS_HSucceeded( hResult, TRUE )
         hResult:=oAIOuterDispatch:GetTypeInfo( iTypeInfo, dwLCID, poAITypeInfo  ; ...
        ... )
         oAIOuterDispatch:Release( )
         oAIOuterDispatch:=NULL_OBJECT
      ELSE
         TSTrace Warning "!TS_HSucceeded(SELF:_OuterAIUnknown:QueryInterface(TS_GUID_IDispatch()" ; ...
        ... +",@oAIOuterDispatch),TRUE)"
         hResult:=DISP_E_UNKNOWNNAME
      END
   OTHERWISE
      hResult:=SELF:_InternalGetTypeInfo( iTypeInfo, dwLCID,  ; ...
     ... poAITypeInfo )
   END
   TSTrace Leave
RETURN hResult