I have a COM server App that and need to link callbacks to specific events which are late bound.
My test VB script is as follows
Sub Main
dim Frm
Set Frm=NewForm("Form1")
Frm.OnActivate = getRef("Frm_OnActivate")
a= Frm.Showmodal
end Sub
sub Frm_OnActivate
MsgBox("Activate")
end Sub
My com server has the onActivate property which is of type OleVariant.
function TALform.Get_OnActivate: OleVariant;
begin
result:=FonActivate;
end;
procedure TALform.Set_OnActivate(Value: OleVariant);
begin
FonActivate:=Value;
Fform.OnActivate:=OnactivateEx
end;
My question is, having got that value, how do I call the VBscript function from the value stored in the Olevariant (which the debugger shows to be of type VarDispatch) ?