IMetaDataEmit::DefineCustomAttribute 方法

建立具有指定中繼資料簽章的自訂屬性定義,以附加至指定的物件,並取得該自訂屬性定義的語彙基元。

語法

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

參數

tkObj
[in] 擁有者項目的語彙基元。

tkType
[in] 可識別自訂屬性的語彙基元。

pCustomAttribute
[in] 自訂屬性的指標。

cbCustomAttribute
[in] pCustomAttribute 中的位元組計數。

pcv
[out] 指派的 mdCustomAttribute 語彙基元。

規格需求

平台:請參閱系統需求

標頭:Cor.h

程式庫:作為 MSCorEE.dll 中的資源使用

.NET Framework版本:自 1.0 起可用

另請參閱