IMetaDataEmit::DefineCustomAttribute Method

为具有指定元数据签名的自定义属性创建定义,并将其附加到指定对象,并获取该自定义属性定义的令牌。

Syntax

HRESULT DefineCustomAttribute (
    [in]  mdToken     tkObj,
    [in]  mdToken     tkType,
    [in]  void const  *pCustomAttribute,
    [in]  ULONG       cbCustomAttribute,
    [out] mdCustomAttribute *pcv
);

Parameters

tkObj [in]所有者项的令牌。

tkType [in]标识自定义属性的标记。

pCustomAttribute [in]指向自定义属性的指针。

cbCustomAttribute [in]字节 pCustomAttribute的计数。

pcv [out] mdCustomAttribute 分配的令牌。

Requirements

平台: 请参阅 .NET 支持的作系统

Header: Cor.h

Library: CorGuids.lib

See also