It is Delphi problem (all version from 5 to latest). Delphi generate all parameters of RecvAction event as Olevariant but TOleControl.InvokeEvent resolve all params from OleVariant to actual type and application failed on locking OleVariant parameters because it is NOT olevariant. More that, last parameter is datetime and some time it is null and TOleControl.InvokeEvent resolve it to integer (4 bytes). But when last parameter is actual datetime then TOleControl.InvokeEvent resolve it to 8 bytes!!! but RecvAction event expect only 4!!! bytes and it is SHIFT ALL PARAMETERS!!!! It is crazy but it is DELPHI CODE in ALL VERSIONS! I resolve this problem by overriding TOleControl.InvokeEvent in generated TLB code as
procedure TActiveHome.InvokeEvent(DispID: TDispID; var Params: TDispParams);
begin
if Params.cArgs=7 then
if Assigned(FOnRecvAction) then
FOnRecvAction(Self,OleVariant(Params.rgvarg[6]),OleVariant(Params.rgvarg[5]),
OleVariant(Params.rgvarg[4]),OleVariant(Params.rgvarg[3]),
OleVariant(Params.rgvarg[2]),OleVariant(Params.rgvarg[1]),
OleVariant(Params.rgvarg[1]));
end;