Export (0) Print
Expand All

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


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


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


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


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


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


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


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

Prior to calling the IMetaDataEmit::DefineImportMember 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.

Platforms: See .NET Framework System Requirements.

Header: Cor.h

Library: Used as a resource in MSCorEE.dll

.NET Framework Versions: 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

© 2014 Microsoft