bindable attribute

The [bindable] attribute indicates that the property supports data binding.

[
    interface-attribute-list
] 
interface | dispinterface interface-name 
{
    [bindable[, attribute-list]] returntype function-name(params)
}

Parameters

interface-attribute-list

Specifies a list of zero or more IDL attributes that apply to the interface as a whole. When two or more interface attributes are present, they must be separated by commas.

interface-name

Specifies the name of the interface.

attribute-list

Specifies zero or more attributes that apply to the function prototype for a property or a method in an interface or dispinterface. The following attributes are valid: [helpstring], [helpcontext], [string], [defaultbind], [displaybind], [immediatebind], [propget], [propput], [propputref], and [vararg]. If vararg is specified, the last parameter must be a safe array of type VARIANT. Separate multiple attributes with commas.

returntype

Specifies the return type of the function.

function-name

Specifies the name of the function to which the [bindable] attribute will be applied.

params

Function parameter list.

Remarks

By supporting data binding, the [bindable] attribute allows the client to be notified whenever a property has changed value. (If you want the client to be notified of impending changes to a property, use the [requestedit] attribute.)

Because the [bindable] attribute refers to the property as a whole, it must be specified wherever the property is defined. Therefore, you need to specify the attribute on both the property-accessing function and the property-setting function.

Flags

FUNCFLAG_FBINDABLE, VARFLAG_FBINDABLE

Examples

[
    uuid(1e196b20-1f3c-1069-996b-00dd010fe676)
]
dispinterface MyObject 
{ 
    properties: 
    methods: 
        [id(1), propget, bindable, defaultbind, displaybind] long x(); 
        [id(1), propput, bindable, 
        defaultbind, displaybind] HRESULT x(long rhs); 
}

See also

defaultbind

dispinterface

displaybind

Generating a Type Library With MIDL

helpstring

helpcontext

immediatebind

interface

ODL File Example

ODL File Syntax

propget

propput

propputref

requestedit

string

TYPEFLAGS

vararg