IMetaDataAssemblyEmit::DefineManifestResource 方法IMetaDataAssemblyEmit::DefineManifestResource Method

创建包含指定清单资源的元数据的 ManifestResource 结构,并返回关联的元数据标记。Creates a ManifestResource structure containing metadata for the specified manifest resource, and returns the associated metadata token.


HRESULT DefineManifestResource (  
    [in] LPCWSTR                szName,
    [in] mdToken                tkImplementation,
    [in] DWORD                  dwOffset,
    [in] DWORD                  dwResourceFlags,  
    [out] mdManifestResource    *pmdmr  


中资源的名称。[in] The name of the resource.

中类型 mdtFilemdtAssemblyRef 映射到资源提供程序的元数据标记。[in] A metadata token of type mdtFile or mdtAssemblyRef that maps to the resource provider. NULL 值指示嵌入元数据的文件是资源提供程序。A NULL value indicates that the file in which the metadata is embedded is the resource provider.

中文件中资源的起始位置的偏移量。[in] The offset to the beginning of the resource within the file. 对于独立文件中的资源,此值将始终为零。For resources in standalone files, this will always be zero. 如果资源嵌入在 PE (可移植可执行文件)文件中,则这是资源 BLOB 的偏移量,它从 cor 头文件中指定的位置开始。If the resource is embedded in a PE (portable executable) file, this is an offset of the resource BLOB, which starts at the location specified in the cor.h header file.

中指定资源定义的属性设置的标志值的按位组合。[in] A bitwise combination of flag values that specify property settings for the resource definition.

弄指向返回的元数据标记的指针。[out] A pointer to the returned metadata token.


必须为每个 ManifestResource 在程序集的文件中实现的每个资源定义一个元数据结构。One ManifestResource metadata structure must be defined for each resource that is implemented in each of the assembly's files.


平台: 请参阅系统要求Platform: See System Requirements.

标头: CorHeader: Cor.h

库: 用作 Mscoree.dll 中的资源Library: Used as a resource in MsCorEE.dll

.NET Framework 版本:自 1.0 之后可用Available since 1.0.NET Framework Versions: 自 1.0 之后可用Available since 1.0

另请参阅See also