共用方式為


3.7.4.6 ITypeInfo::GetRefTypeOfImplType (Opnum 8)

The GetRefTypeOfImplType method retrieves the HREFTYPE corresponding to the automation type description of an interface that is inherited, implemented, or referenced by the ITypeInfo server.

 HRESULT GetRefTypeOfImplType(
   [in] UINT index,
   [out] HREFTYPE* pRefType
 );

index: MUST be a nonnegative integer, or -1.

If the ITypeInfo server describes a dual interface (see sections 2.2.49.4.2 and 3.7.1), the value of index MUST be 0 or -1.

If the ITypeInfo server describes a coclass, the value of index MUST be nonnegative and less than the value of the cImplTypes field in the TYPEATTR (section 2.2.44) structure returned by the GetTypeAttr (section 3.7.4.1) method.

For all other ITypeInfo servers, the value of index MUST be 0.

pRefType: MUST be set to one of the following values, if index is -1 or specifies an interface table entry.

If the ITypeInfo server describes a dual interface and index is -1, pRefType is specified by the TYPEKIND value associated with the ITypeInfo server (see section 2.2.44):

TKIND_DISPATCH: MUST be set to the HREFTYPE of the partner interface.

TKIND_INTERFACE: MUST be set to the HREFTYPE of the partner dispinterface.

In all other cases, pRefType is specified by the interface table member whose ordinal position is specified by index:

If the interface table member is a dual interface and the ITypeInfo server describes a DCOM interface or partner interface, pRefType MUST be the HREFTYPE of the partner interface of the interface table member.

Note This is the only case where an OLE Automation Protocol interface method returns a partner interface by default.

If the interface table member is a dual interface and the ITypeInfo server describes a coclass, pRefType MUST be the HREFTYPE of the partner dispinterface of the interface table member.

MUST be set to the HREFTYPE of the interface table member in all other cases.

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 interface table, or the value of index was -1 and the type was not a dual interface. See [MS-ERREF].