actually i am using late-binding in delphi, and i need to know wich is the proper way to work with it.
My principal concern is about how I handle the memory used by these objects, I must free the memory?
check this sample code
var
chEaten: Integer;
BindCtx: IBindCtx;
Moniker: IMoniker;
MyObject:: IDispatch;
begin
try
OleCheck(CreateBindCtx(0, bindCtx));
OleCheck(MkParseDisplayName(BindCtx, StringToOleStr('oleobject.class'), chEaten, Moniker));
OleCheck(Moniker.BindToObject(BindCtx, nil, IDispatch, MyObject));
MyObject.Metod1();
MyObject.Metod2();
finally
MyObject:=nil,// is this necesary?
end;
end;
would be helpful if someone explain briefly how is handled the memory in this type of objects.
thanks in advance.