Pascal Scripting: IDispatchInvoke

Inno Setup

Pascal Scripting: IDispatchInvoke

Prototype:

function IDispatchInvoke(Self: IDispatch; PropertySet: Boolean; const Name: String; Par: array of Variant): Variant;

Description:

Use IDispatchInvoke to access a COM Automation property or method whose name is a reserved word.

Example:
var
  AObject: Variant;
  AType: String;
begin
  AObject := CreateOleObject('MyObject');
  // Set a property named 'Type'
  // Cannot use "AObject.Type := 'MyType';" because Type is a reserved word
  IDispatchInvoke(AObject, True, 'Type', ['MyType']);
  // Get a property or call a method named 'Type'
  AType := IDispatchInvoke(AObject, False, 'Type', ['']);
end;
See also:

Using COM Automation objects