Поделиться через


bindable

Указывает, что свойство поддерживает привязку данных.

[bindable]

Заметки

bindable Атрибут C++ имеет ту же функциональность, что и bindable атрибут MIDL. Можно использовать его для свойств, определенных с propget" propputили propputref атрибуты, либо можно вручную определить связываемая метод.

В следующих примерах показано использование MFC bindable.

Пример

Следующий код показывает, как можно использовать bindable свойства:

// cpp_attr_ref_bindable.cpp
// compile with: /LD
#include <windows.h>
[
   uuid("479B29E3-9A2C-11D0-B696-00A0C903487A"),
   dispinterface,
   helpstring("property demo Interface")
]
__interface IPropDemo : IDispatch {

   [propget, id(1), bindable, displaybind, defaultbind, requestedit] HRESULT P1([out, retval] long *nSize);
   [propput, id(1), bindable, displaybind, defaultbind, requestedit] HRESULT P1([in] long nSize);
   [id(3), bindable, propget] HRESULT Object([out, retval] IDispatch **ppObj);
   [id(3), bindable, propputref] HRESULT Object([in] IDispatch* pObj);   
   [id(-552), helpstring("method AboutBox")] HRESULT AboutBox();
};

[ module(name="PropDemoLib", uuid="479B29E2-9A2C-11D0-B696-00A0C903487A", version="1.0", helpstring="property demo") ];

Требования

Контекст атрибута

Применение

Метод интерфейса

Repeatable

Нет

Обязательные атрибуты

None

Недопустимые атрибуты

None

Дополнительные сведения о контекстах атрибута см. в разделе Контексты атрибута.

См. также

Ссылки

defaultbind

displaybind

immediatebind

requestedit

Другие ресурсы

Атрибуты IDL

Атрибуты метода

Attributes Samples