Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method retrieves the specified type description in the library.

Syntax

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

Parameters

index

[in] Index of the ITypeInfointerface to be returned.

ppTInfo

[out] If successful, returns a pointer to the pointer to the ITypeInfointerface.

Return Value

The following table shows the return values for this function.

Value Description

S_OK

Success.

TYPE_E_ELEMENTNOTFOUND

The indexparameter is outside the range of 0 to ITypeLib::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::GetTypeInforeturns only the TKIND_DISPATCH type information.

To get the TKIND_INTERFACE type information, ITypeInfo::GetRefTypeOfImplTypecan be called on the TKIND_DISPATCH type information, passing an indexof –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.

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

Requirements

Header oaidl.h, oaidl.idl
Library oleaut32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also