I'm creating a class out of a C header converted to pascal using h2pas.

I created this type:

pRobotArray = ^TArray0toMAX_ROBOT_DRIVES1OfHANDLE;

If I use it inside a method, like this:

procedure TMyClass.myMethod;
var
  lRobots: pRobotArray;
begin
  getRobots(lHRobots);
  lRobots := @lHRobots; // this works ok.
end;

If I add an FRobots var to my class:

TRobotClass = class
private
  FRobots: pRobotArray;
public
  procedure myMethod;
end;

procedure TMyClass.myMethod;
begin
  getRobots(lHRobots);
  FRobots := @lHRobots; // I get an external SIGSEGV.
end;

Why the difference?.


Regards,
--
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to