It is very easy. The way you can do late binding in Delphi is generally by using OleVariant variables.
By using typed variables you are using early binding. This is a snippet of code from the unit fMainForm.pas
in the WordProcessor directory:
implementation
uses ComObj;
{$R *.DFM}
procedure TForm1.bLateBindingClick(Sender: TObject);
var myobj :
OleVariant;
begin
myobj := CreateOLEObject('COMCOnverter.ConverterList');
end;
As you can see, the only differences between the two are the type of myobj and the instantiation of it.
The fact that you declared myobj as an OleVariant is the key here. That tells Delphi how you invoke the
methods of a COM object. Anytime you use an OleVariant you can specify any method name. The compiler won't
complain. Try putting myobj.XYZ in the first event handler. Delphi will successfully compile it but at
runtime will raise an exception as soon as you hit that line of code. Late binding .
In the second case you wouldn't be able to compile it, because IConverterList doesn't define have a method
called XYZ. Early binding .