Please login or register.

Login with username, password and session length

Author Topic: SDK & delphi 7 RecvAction error  (Read 10286 times)

JDB

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
SDK & delphi 7 RecvAction error
« on: December 22, 2007, 09:33:39 AM »

I just down loaded the sdk installed it in delphi 7.   I can send commands fine, but when I try to use the RecvAction I get and "Invalid variant Type".  Can anybody help me.   I saw some old Post out here about some people having problems but those were 2 years ago?

Thanks  Jerry
Logged

ddv2005

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: SDK & delphi 7 RecvAction error
« Reply #1 on: January 04, 2008, 10:30:15 PM »

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;
Logged

rordonez

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: SDK & delphi 7 RecvAction error
« Reply #2 on: February 26, 2008, 11:00:02 PM »

Where on the TLB Code do you paste this code to Override the invokeEvent Function?

what kind of declaration does the override need.



Logged

disappear

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: SDK & delphi 7 RecvAction error
« Reply #3 on: January 12, 2009, 05:53:26 AM »

Can u Resolved this problem ? i have this problem . when i use the RecvAction my application is locked .
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.