3.11.4.2 ITypeLib::GetTypeInfo (Opnum 4)

The GetTypeInfo method retrieves the automation type description that has the specified ordinal position within the type information table.

 HRESULT GetTypeInfo(
   [in] UINT index,
   [out] ITypeInfo** ppTInfo
 );

index: MUST equal the ordinal position of the specified automation type description within the type information table.

ppTInfo: MUST be set to a reference to the ITypeInfo server instance (see section 3.7) with the specified position in the type information table, or to NULL if the value of index is greater than or equal to the number of automation type descriptions in the type information table.

MUST refer to the partner dispinterface if index specifies a dual interface. To retrieve the ITypeInfo server that corresponds to the partner interface, the client MUST call the GetRefTypeOfImplType and GetRefTypeInfo methods of the ITypeInfo instance that correspond to the partner dispinterface, as specified in sections 3.7.4.6 and 3.7.4.10.

Return Values: The method MUST return information in an HRESULT data structure, defined in [MS-ERREF] section 2.1. The severity bit in the structure identifies the following conditions:

  • If the severity bit is set to 0, the method completed successfully.

  • If the severity bit is set to 1 and the entire HRESULT DWORD does not match a value in the following table, a fatal failure occurred.

  • If the severity bit is set to 1 and the entire HRESULT DWORD matches a value in the following table, a failure occurred.

    Return value/code

    Description

    0x8002802B

    TYPE_E_ELEMENTNOTFOUND

    The value of index did not specify the ordinal position of an element in the type information table. See [MS-ERREF].