(* Collection of code snippets by Arne Vajhøj *)
(* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) *)
program TestTest;

uses
  ActiveX,ComObj;

var
  test, another : Variant;

begin
  writeln('COM/Pascal dynamic:');
  CoInitialize(nil);
  test := CreateOLEObject('Test.CoTest');
  writeln('123 + 456 = ', test.Add(123, 456));
  writeln('123 + default = ', test.Add(123));
  writeln('ABC + XYZ = ', test.Concat('ABC', 'XYZ'));
  writeln('ABC + default = ', test.Concat('ABC'));
  writeln('IV = ', test.IV, ' SV = ', test.SV); 
  test.IV := 123;
  test.SV := 'ABC';
  writeln('IV = ', test.IV, ' SV = ', test.SV); 
  another := test.Another;
  writeln('Another 123 + 456 = ', another.Add(123, 456));
  (* second non-default interface is not accessible *)
  CoUninitialize;
end.
