Partager via


IMetaDataEmit::DefineImportType Method

Creates a reference to the specified type that is defined outside the current scope, and defines a token for that reference.

HRESULT DefineImportType ( 
    [in]  IMetaDataAssemblyImport  *pAssemImport, 
    [in]  const void               *pbHashValue, 
    [in]  ULONG                    cbHashValue,  
    [in]  IMetaDataImport          *pImport, 
    [in]  mdTypeDef                tdImport, 
    [in]  IMetaDataAssemblyEmit    *pAssemEmit, 
    [out] mdTypeRef                *ptr
);

Parameters

Parameter Description

pAssemImport

[in] An IMetaDataAssemblyImport Interface interface that represents the assembly from which the target type is imported.

pbHashValue

[in] An array that contains the hash for the assembly specified by pAssemImport.

cbHashValue

[in] The number of bytes in the pbHashValue array.

pImport

[in] An IMetaDataImport Interface interface that represents the metadata scope from which the target type is imported.

tdImport

[in] An mdTypeDef token that specifies the target type.

pAssemEmit

[in] An IMetaDataAssemblyEmit Interface interface that represents the assembly into which the target type is imported.

ptr

[out] The mdTypeRef token that is defined in the current scope for the type reference.

Remarks

Prior to calling the IMetaDataEmit::DefineImportMember Method method, you can use the DefineImportType method to create a type reference, in the current scope, for the member's parent class or parent interface.

Requirements

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

Header: Cor.h

Library: Used as a resource in Mscoree.dll

.NET Framework Version: 2.0, 1.1, 1.0

See Also

Reference

IMetaDataEmit Interface
IMetaDataEmit2 Interface