__dispid

From RAD Studio
Jump to: navigation, search

Go Up to Keywords, Alphabetical Listing Index


Category

Modifiers (C++)

Syntax

__dispid(constant int expression)

Description

A member function that has been declared in the __automated section of a class can include an optional __dispid (constant int expression) directive. The directive must be declared after the closing parenthesis of the parameter list.

The constant int expression gives the Automation dispatch ID of the member function or property. If a __dispid directive is not used, the compiler automatically picks a number one larger than the largest dispatch ID used by any member function or property in the class and its base classes.

Specifying an already used dispatch ID in a __dispid directive causes a compile-time error.

Example

Note that for declaring the dispatch ID for a property in C++, the dispid modifier (no underscores) must be used.

class T : public System::TObject {
__automated:
	int __fastcall f(void) __dispid(2) {
		return 0;
	}
	__property int P = {read = f, dispid = 1};
};

See Also