次の方法で共有


IDebugCustomAttributeQuery2::GetCustomAttributeByName

Obtains the custom attributes bytes given the name of the custom attribute.

HRESULT GetCustomAttributeByName( 
   LPCOLESTR pszCustomAttributeName,
   BYTE*     ppBlob,
   DWORD*    pdwLen
);
int GetCustomAttributeByName(
   [In] string        pszCustomAttributeName, 
   [In, Out] byte[]   ppBlob, 
   [In, Out] ref uint pdwLen
);

Parameters

  • pszCustomAttributeName
    [in] A string containing the name of the custom attribute to look for.

  • ppBlob
    [in, out] An array that is filled in with the custom attribute bytes.

  • pdwLen
    [in, out] Specifies the maximum number of bytes to return in the ppBlob array and returns the number of bytes actually written to the array.

Return Value

If successful, returns S_OK or returns S_FALSE if the custom attribute does not exist. Otherwise, returns an error code.

Remarks

Set the ppBlob parameter to a null value to return the number of attributes bytes available. Then allocate an array and pass that array in for the ppBlob parameter.

The attribute bytes represent the raw data of the custom attribute.

If the ppBlob and pdwLen parameters are set to a null value, this method can be used to determine if the custom attribute merely exists. An easier alternative, however, is to call the IDebugCustomAttributeQuery2::IsCustomAttributeDefined method.

See Also

Reference

IDebugCustomAttributeQuery2

IDebugCustomAttributeQuery2::IsCustomAttributeDefined