Quick start manual
Object interfaces
10-13
Automation objects (Windows only)
Some Automation servers allow you to omit parameters from a method call,
accepting their default values. For example,
Word.FileSaveAs('test.doc');
Word.FileSaveAs('test.doc', 6);
Word.FileSaveAs('test.doc',,,'secret');
Word.FileSaveAs('test.doc', Password := 'secret');
Word.FileSaveAs(Password := 'secret', Name := 'test.doc');
Automation method call parameters can be of integer, real, string, Boolean, and
variant types. A parameter is passed by reference if the parameter expression
consists only of a variable reference, and if the variable reference is of type Byte,
Smallint, Integer, Single, Double, Currency, TDateTime, AnsiString, WordBool, or Variant.
If the expression is not of one of these types, or if it is not just a variable, the
parameter is passed by value. Passing a parameter by reference to a method that
expects a value parameter causes COM to fetch the value from the reference
parameter. Passing a parameter by value to a method that expects a reference
parameter causes an error.
Dual interfaces (Windows only)
A dual interface is an interface that supports both compile-time binding and runtime
binding through Automation. Dual interfaces must descend from IDispatch.
All methods of a dual interface (except from those inherited from IInterface and
IDispatch) must use the safecall convention, and all method parameter and result
types must be automatable. (The automatable types are Byte, Currency, Real, Double,
Real48, Integer, Single, Smallint, AnsiString, ShortString, TDateTime, Variant,
OleVariant, and WordBool.)