custom attribute

The [custom] attribute creates a user-defined attribute.

[custom(attribute-id, attribute-value),attribute-list] element-type element-name

Parameters

attribute-id

The GUID for the custom attribute.

attribute-value

The value that the attribute holds. The value must be one that can be put into a VARIANT type.

attribute-list

Other attributes, such as [uuid] and [helpstring], that apply to this element.

element-type

The type of element to which the custom attribute applies. This can be a library statement, type information, a variable, a function, or a parameter. You cannot use a custom attribute on a member of a coclass.

element-name

The name of the element.

Remarks

Use the [custom] attribute to define your own attribute. For example, you might create a string-valued attribute that gives the ProgID for a class.

To retrieve a custom attribute value call one of the following:

  • ITypeLib2::GetCustData(rguid, pvarVal)
  • ITypeInfo2::GetCustData(rguid, pvarVal)
  • ITypeInfo2::GetFuncCustData(index, rguid, pvarVal)
  • ITypeInfo2::GetVarCustData(index, rguid, pvarval)
  • ITypeInfo2::GetParamCustData(indexFunc, indexParam, rguid, pvarVal)

See also

Generating a Type Library With MIDL

helpstring

library

ODL File Example

ODL File Syntax

uuid