IMetaDataAssemblyEmit::DefineManifestResource Method

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.

[in] A metadata token of type mdtFile or mdtAssemblyRef that maps to the resource provider. 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. 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.


One ManifestResource metadata structure must be defined for each resource that is implemented in each of the assembly's files.


Platform: See System Requirements.

Header: Cor.h

Library: Used as a resource in MsCorEE.dll

.NET Framework Versions: Available since 1.0

See Also

IMetaDataAssemblyEmit Interface