oleautomation

Description

The oleautomation attribute indicates that an interface is compatible with Automation.

Allowed on

Interface.

Comments

Not allowed on dispinterfaces.

The parameters and return types specified for its members must be compatible with Automation, as listed in the following table:

Type Description
boolean Data item that can have the value True or False. The size corresponds to VARIANT_BOOL. Use VARIANT_TRUE, VARIANT_FALSE.
unsigned char 8-bit unsigned data item.
double 64-bit IEEE floating-point number.
float 32-bit IEEE floating-point number.
int Signed integer, whose size is system dependent.
long 32-bit signed integer.
short 16-bit signed integer.
BSTR Length-prefixed string, as described in Chapter 5, "Dispatch Interface and API Functions."
CURRENCY 8-byte, fixed-point number.
DATE 64-bit, floating-point fractional number of days since December 30, 1899.
SCODE For 16-bit systems - Built-in error type that corresponds to VT_ERROR.
Typedef enum myenum Signed integer, whose size is system dependent.
Interface IDispatch * Pointer to the IDispatch interface (VT_DISPATCH).
Interface IUnknown * Pointer to an interface that does not derive from IDispatch (VT_UNKNOWN). (Any OLE interface can be represented by its IUnknown interface.)
dispinterface Typename * Pointer to an interface derived from IDispatch (VT_DISPATCH).
Coclass Typename * Pointer to a coclass name (VT_UNKNOWN).
[oleautomation] interface Typename * Pointer to an interface that derives from IDispatch.
SAFEARRAY(TypeName) TypeName is any of the above types. Array of these types.
TypeName* TypeName is any of the above types. Pointer to a type.
Decimal 96-bit unsigned binary integer scaled by a variable power of 10. A decimal data type that provides a size and scale for a number (as in coordinates).

A parameter is compatible with Automation if its type is compatible with an Automation type, a pointer to an Automation type, or a SAFEARRAY of an Automation type.

A return type is compatible with Automation if its type is an HRESULT or is void. Methods in Automation must return either HRESULT or void.

A member is compatible with Automation if its return type and all of its parameters are compatible with Automation.

An interface is compatible with Automation if it derives from IDispatch or IUnknown, if it has the oleautomation attribute, or if all of its VTBL entries are compatible with Automation. For 32-bit systems, the calling convention for all methods in the interface must be STDCALL. For 16-bit systems, all methods must have the CDECL calling convention. Every dispinterface is compatible with Automation.

Flags

TYPEFLAG_FOLEAUTOMATION