ITypeLib::GetTypeInfo
This method retrieves the specified type description in the library.
HRESULT GetTypeInfo(
unsigned int index,
ITypeInfo FAR* FAR* ppTInfo
);
Parameters
- index
[in] Index of the ITypeInfo interface to be returned. - ppTInfo
[out] If successful, returns a pointer to the pointer to the ITypeInfo interface.
Return Values
The following table shows the return values for this function.
Value | Description |
---|---|
S_OK | Success. |
TYPE_E_ELEMENTNOTFOUND | The index parameter 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::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);
Requirements
OS Versions: Windows CE 2.0 and later.
Header: Oaidl.h, Oaidl.idl.
Link Library: Oleaut32.lib, Uuid.lib.
See Also
ITypeLib | ITypeInfo::GetRefTypeInfo | ITypeInfo::GetRefTypeOfImplType | ITypeLib::GetTypeInfoCount
Last updated on Wednesday, April 13, 2005
© 2005 Microsoft Corporation. All rights reserved.