Hello
there is a code
var
myobject:OleVariant;
begin
myobject:=CreateOleObject('SomeNamespace.SomeClass');
end;
this com object has event OnClick for example. How must I connect to them without importing tlb?
Regards, Yuriy
Hello
there is a code
var
myobject:OleVariant;
begin
myobject:=CreateOleObject('SomeNamespace.SomeClass');
end;
this com object has event OnClick for example. How must I connect to them without importing tlb?
Regards, Yuriy
You are working with COM late-binding, so do you need write a lot of code to handle events. this task is not difficult if you know COM, basically do you need follow these steps.
TInterfacedObject
that implements
IDispatch
Invoke()
function of your new classIConnectionpointContainer
) and desired connection point.IConnectionPointContainer.FindConnectionPoint
IConnectionPoint.Advise()
using your implementation of
the IDispatch
you can found examples of this implementation on these links
try out these links for more info about COM, late-binding and events