We recommend using Visual Studio 2017

Method Attributes


The latest version of this topic can be found at Method Attributes.

The following attributes apply to the methods in a class, coclass, or interface.

bindableIndicates that the property supports data binding.
call_asEnables a nonremotable function to be mapped to a remote function.
customLets you define your own attribute.
db_columnBinds a specified column to the rowset.
db_commandCreates an OLE DB command.
db_paramAssociates the specified member variable with an input or output parameter and delimits the variable.
db_sourceCreates a connection to a data source.
db_tableOpens an OLE DB table.
defaultbindIndicates the single, bindable property that best represents the object.
defaultcollelemUsed for Visual Basic code optimization.
displaybindIndicates a property that should be displayed to the user as bindable.
helpcontextSpecifies a context ID that lets the user view information about this element in the Help file.
helpfileSets the name of the Help file for a type library.
helpstringSpecifies a character string that is used to describe the element to which it applies.
helpstringcontextSpecifies the ID of a help topic in an .hlp or .chm file.
helpstringdllSpecifies the name of the DLL to use to perform document string lookup (localization).
hiddenIndicates that the item exists but should not be displayed in a user-oriented browser.
idSpecifies a DISPID for a member function (either a property or a method, in an interface or dispinterface).
immediatebindIndicates that the database will be notified immediately of all changes to a property of a data-bound object.
inIndicates that a parameter is to be passed from the calling procedure to the called procedure.
localAllows you to use the MIDL compiler as a header generator when used in the interface header. When used in an individual function, designates a local procedure for which no stubs are generated.
nonbrowsableIndicates that an interface member should not be displayed in a property browser.
propgetSpecifies a property accessor function.
propputSpecifies a property-setting function.
propputrefSpecifies a property-setting function that uses a reference instead of a value.
ptrDesignates a pointer as a full pointer.
rangeSpecifies a range of allowable values for arguments or fields whose values are set at run time.
requesteditIndicates that the property supports the OnRequestEdit notification.
restrictedSpecifies that a member of a module, interface, or dispinterface cannot be called arbitrarily.
satypeSpecifies the data type of the SAFEARRAY structure.
sourceSpecifies the control's source interfaces for connection points on a class. On a property or method, the source attribute indicates that the member returns an object or VARIANT that is a source of events.
synchronizeSynchronizes access to the target method.
varargSpecifies that the function take a variable number of arguments.

Attributes by Usage