ITypeLib::GetTypeInfo

This method retrieves the specified type description in the library.

At a Glance

Header file: Oaidl.h
Windows CE versions: 2.0 and later

Syntax

HRESULT GetTypeInfo( unsigned int index, ITypeInfo FAR* FAR* ppTInfo );

Parameters

index

Index of the ITypeInfo interface to be returned.

ppTInfo

If successful, returns a pointer to the pointer to the ITypeInfo interface.

Return Values

One of the values described in the following table is returned.

Value Description
S_OK Success.
TYPE_E_ELEMENTNOTFOUND The index parameter is outside the range of 0 to GetTypeInfoCount –1.
E_OUTOFMEMORY Out of memory.
E_INVALIDARG One or more of the parameters is invalid.
TYPE_E_IOERROR The function could not read from the file.
TYPE_E_INVDATAREAD Invalid data.
TYPE_E_UNSUPFORMAT The type library has an older format.
TYPE_E_REGISTRYACCESS There was an error accessing the system registration database.
TYPE_E_INVALIDSTATE The type library could not be opened.

Remarks

For dual interfaces, ITypeLib::GetTypeInfo returns only the TKIND_DISPATCH type information. To get the TKIND_INTERFACE type information, ITypeInfo::GetRefTypeOfImplType can be called on the TKIND_DISPATCH type information, passing an index of –1. Then, the returned type information handle can be passed to ITypeInfo::GetRefTypeInfo.

Example

The following code example gets the TKIND_INTERFACE type information for a dual interface.

ptlib->GetTypeInfo((unsigned int) dwIndex, &ptypeinfoDisp);
ptypeinfoDisp->GetRefTypeOfImplType(-1, &phreftype);
ptypeinfoDisp->GetRefTypeInfo(phreftype, &ptypeinfoInt);