GetTypeInfoCount
(Available in 01 TS COM - TS_COM_IDispatch)
Purpose
Test if the interface supports typeinfo
Syntax
hResult:=oSomeIObject:GetTypeInfoCount( @iTypeInfoCount )
Arguments
Description
Test if the interface supports typeinfo, If the interface supports typeinfo this methos will return 1 else 0.
MSDN ==== IDispatch::GetTypeInfoCount Retrieves the number of type information interfaces that an object provides (either 0 or 1).
HRESULT GetTypeInfoCount( unsigned int FAR* pctinfo );
Parameter pctinfo = Points to a location that receives the number of type information interfaces provided by the object. If the object provides type information, this number is 1; otherwise the number is 0.
Return Value The return value obtained from the returned HRESULT is one of the following:
Return value Meaning S_OK = Success. E_NOTIMPL = Failure.
Comments The function may return zero, which indicates that the object does not provide any type information. In this case, the object may still be programmable through IDispatch or a VTBL, but does not provide run-time type information for browsers, compilers, or other programming tools that access type information. This can be useful for hiding an object from browsers.
Returns
hResult
Example
LOCAL iTypeInfoCount AS INT
hResult:=oSomeIObject:GetTypeInfoCount( @iTypeInfoCount )
IF TS_Succeeded( hResult )
IF iTypeInfoCount<>0
// The interface supports type info
ELSE
// No typeinfo available on this interface
END
END
Source
METHOD GetTypeInfoCount( pTypeInfoCount AS INT 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 pTypeInfoCount<>NULL_PTR
INT( pTypeInfoCount ):=0
ELSE
TSTrace Warning "pTypeInfoCount==NULL_PTR"
END
hResult:=E_NOTIMPL
CASE LOGIC( _CAST, SELF:_OuterAIUnknown