Compartilhar via


IMetaDataImport::ResolveTypeRef Method

Resolves a Type reference represented by the specified TypeRef token.

HRESULT ResolveTypeRef (
      [in]  mdTypeRef       tr,
      [in]  REFIID          riid,
      [out] IUnknown        **ppIScope,
      [out] mdTypeDef       *ptd
);

Parameters

  • tr
    [in] The TypeRef metadata token to return the referenced type information for.

  • riid
    [in] The IID of the interface to return in ppIScope. Typically, this would be IID_IMetaDataImport.

  • ppIScope
    [out] An interface to the module scope in which the referenced type is defined.

  • ptd
    [out] A pointer to a TypeDef token that represents the referenced type.

Remarks

The ResolveTypeRef method searches for the type definition in other modules. If the type definition is found, ResolveTypeRef returns an interface to that module scope as well as the TypeDef token for the type.

If the type reference to be resolved has a resolution scope of AssemblyRef, the ResolveTypeRef method searches for a match only in the metadata scopes that have already been opened with calls to either the IMetaDataDispenser::OpenScope method or the IMetaDataDispenser::OpenScopeOnMemory method. This is because ResolveTypeRef cannot determine from only the AssemblyRef scope where on disk or in the global assembly cache the assembly is stored.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: Cor.h

Library: Included as a resource in MsCorEE.dll

.NET Framework Version: 2.0, 1.1, 1.0

See Also

Concepts

IMetaDataImport Interface

IMetaDataImport2 Interface