Udostępnij za pośrednictwem


Attributes Alphabetical Reference

The following attributes are available in Visual C++.

Attribute

Description

aggregatable

Indicates that a control can be aggregated by another control.

aggregates

Indicates that a control aggregates the target class.

appobject

Identifies the coclass as an application object, which is associated with a full EXE application, and indicates that the functions and properties of the coclass are globally available in this type library.

async_uuid

Specifies the UUID that directs the MIDL compiler to define both synchronous and asynchronous versions of a COM interface.

attribute

Allows you to create a custom attribute.

bindable

Indicates that the property supports data binding.

call_as

Enables a nonremotable function to be mapped to a remote function.

case

Used with the switch_type attribute in a union.

coclass

Creates a COM object, which can implement a COM interface.

com_interface_entry

Adds an interface entry to a COM map.

control

Specifies that the user-defined type is a control.

cpp_quote

Emits the specified string, without the quote characters, into the generated header file.

custom

Lets you define your own attributes.

db_accessor

Binds columns in a rowset and binds them to the corresponding accessor maps.

db_column

Binds a specified column to the rowset.

db_command

Executes an OLE DB command.

db_param

Associates the specified member variable with an input or output parameter.

db_source

Creates and encapsulates a connection, through a provider, to a data source.

db_table

Opens an OLE DB table.

default

Indicates that the custom or dispinterface defined within a coclass represents the default programmability interface.

defaultbind

Indicates the single, bindable property that best represents the object.

defaultcollelem

Used for Visual Basic code optimization.

defaultvalue

Allows specification of a default value for a typed optional parameter.

defaultvtable

Defines an interface as the default vtable interface for a control.

dispinterface

Places an interface in the .idl file as a dispatch interface.

displaybind

Indicates a property that should be displayed to the user as bindable.

dual

Places an interface in the .idl file as a dual interface.

emitidl

Determines whether all subsequent IDL attributes will be processed and placed in the generated .idl file.

entry

Specifies an exported function or constant in a module by identifying the entry point in the DLL.

event_receiver

Creates an event receiver.

event_source

Creates an event source.

export

Causes a data structure to be placed in the .idl file.

first_is

Specifies the index of the first array element to be transmitted.

helpcontext

Specifies a context ID that lets the user view information about this element in the Help file.

helpfile

Sets the name of the Help file for a type library.

helpstring

Specifies the ID of a help topic in an .hlp or .chm file.

helpstringdll

Specifies the name of the DLL to use to perform document string lookup (localization).

hidden

Indicates that the item exists but should not be displayed in a user-oriented browser.

id

Specifies a DISPID for a member function (either a property or a method, in an interface or dispinterface).

idl_module

Specifies an entry point in a DLL.

idl_quote

Allows you to use attributes or IDL constructs that are not supported in the current version of Visual C++.

iid_is

Specifies the IID of the COM interface pointed to by an interface pointer.

immediatebind

Indicates that the database will be notified immediately of all changes to a property of a data-bound object.

implements

Specifies dispatch interfaces that are forced to be members of the IDL coclass.

implements_category

Specifies implemented component categories for the class.

import

Specifies another .idl, .odl, or header file containing definitions you want to reference from your main .idl file.

importidl

Inserts the specified .idl file into the generated .idl file.

importlib

Makes types that have already been compiled into another type library available to the type library being created.

in

Indicates that a parameter is to be passed from the calling procedure to the called procedure.

include

Specifies one or more header files to be included in the generated .idl file.

includelib

Causes an .idl or .h file to be included in the generated .idl file.

last_is

Specifies the index of the last array element to be transmitted.

lcid

Lets you pass a locale identifier to a function.

length_is

Specifies the number of array elements to be transmitted.

library_block

Places a construct inside the .idl file's library block.

licensed

Indicates that the coclass to which it applies is licensed, and must be instantiated using IClassFactory2.

local

Allows 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.

max_is

Designates the maximum value for a valid array index.

module

Defines the library block in the .idl file.

ms_union

Controls the network data representation alignment of nonencapsulated unions.

no_injected_text

Prevents the compiler from injecting code as a result of attribute use.

nonbrowsable

Indicates that an interface member should not be displayed in a property browser.

noncreatable

Defines an object that cannot be instantiated by itself.

nonextensible

Specifies that the IDispatch implementation includes only the properties and methods listed in the interface description and cannot be extended with additional members at run time.

object

Identifies a custom interface; synonymous with custom attribute.

odl

Identifies an interface as an Object Description Language (ODL) interface.

oleautomation

Indicates that an interface is compatible with Automation.

optional

Specifies an optional parameter for a member function.

out

Identifies pointer parameters that are returned from the called procedure to the calling procedure (from the server to the client).

pointer_default

Specifies the default pointer attribute for all pointers except top-level pointers that appear in parameter lists.

pragma

Emits the specified string, without the quote characters, into the generated .idl file.

progid

Specifies the ProgID for a COM object.

propget

Specifies a property accessor (get) function.

propput

Specifies a property setting function.

propputref

Specifies a property setting function that uses a reference instead of a value.

ptr

Designates a pointer as a full pointer.

public

Ensures that a typedef will go into the type library even if it is not referenced from within the .idl file.

range

Specifies a range of allowable values for arguments or fields whose values are set at run time.

rdx

Creates or modifies a registry key.

readonly

Prohibits assignment to a variable.

ref

Identifies a reference pointer.

registration_script

Executes the specified registration script.

requestedit

Indicates that the property supports the OnRequestEdit notification.

requires_category

Specifies required component categories for the class.

restricted

Specifies that a library, or member of a module, interface, or dispinterface cannot be called arbitrarily.

retval

Designates the parameter that receives the return value of the member.

satype

Specifies the data type of the SAFEARRAY.

size_is

Specifies the size of memory allocated for sized pointers, sized pointers to sized pointers, and single- or multidimensional arrays.

source

Indicates that a member of a class, property, or method is a source of events.

string

Indicates that the one-dimensional char, wchar_t, byte, or equivalent array or the pointer to such an array must be treated as a string.

support_error_info

Supports error reporting for the target object.

switch_is

Specifies the expression or identifier acting as the union discriminant that selects the union member.

switch_type

Identifies the type of the variable used as the union discriminant.

synchronize

Synchronizes access to a method.

threading

Specifies the threading model for a COM object.

transmit_as

Instructs the compiler to associate a presented type, which client and server applications manipulate, with a transmitted type.

uidefault

Indicates that the type information member is the default member for display in the user interface.

unique

Specifies a unique pointer.

usesgetlasterror

Tells the caller that if there is an error when calling that function, the caller can then call GetLastError to retrieve the error code.

uuid

Specifies the unique ID for a class or interface.

v1_enum

Directs that the specified enumerated type be transmitted as a 32-bit entity, rather than the 16-bit default.

vararg

Specifies that the function take a variable number of arguments.

version

Identifies a particular version among multiple versions of an interface or class.

vi_progid

Specifies a version-independent form of the ProgID.

wire_marshal

Specifies a data type that will be used for transmission instead of an application-specific data type.

See Also

Other Resources

C++ Attributes Reference

Attributed Programming Concepts

Attributes by Group

Attributes by Usage