procedure TForm1.Button1Click(Sender: TObject); var V: Variant; begin V := IDispatch(CoOptionalParamsDemo.Create()); V.GetParams('123'); end; procedure TForm1.Button2Click(Sender: TObject); var AIntf: IOptionalParamsDemo; V: Variant; begin AIntf := CoOptionalParamsDemo.Create(); // AIntf.GetParams('', EmptyParam, 9, 4); V := IDispatch(AIntf); // V.GetParams('123', '123', '123', '123'); V.GetParams(); end; procedure TForm1.Button3Click(Sender: TObject); var AIntf: IOptionalParamsDemo; V: Variant; begin AIntf := CoOptionalParamsDemo.Create(); // AIntf.GetParams('', EmptyParam, 9, 4); V := IDispatch(AIntf); V.GetParams('123', '123'); // V.GetParams(); end; procedure TForm1.Button4Click(Sender: TObject); var V: Variant; begin V := IDispatch(CoOptionalParamsDemo.Create()); V.GetParams('123', '123', 123); end; procedure TForm1.Button5Click(Sender: TObject); var V: Variant; begin V := IDispatch(CoOptionalParamsDemo.Create()); V.GetParams('123', 123, 123, 6); end;