[Shapelib] Problems using SHPDestroyObject()

Mario Härtwig mario.haertwig at gmail.com
Mon Nov 22 06:18:24 EST 2010


Hi all,
I am trying to write an intersection-tool with Delphi using ShapeLib 1.2.10.
Everything works proper with small shapes but when I try to intersect bigger
shapes, after some time an access-violation message occurs when I try to
read a shape using the SHPReadObject()-method.
Possibly the problem is that I am not using SHPDestroyObject(). It causes an
error-message the first time I access it.

The following code works fine:
      pSHPStr := SHPReadObject(hSHPHandleStr,i);
      SHPDestroyObject(pSHPStr);

This code causes an cpu-error-message in my Delphi IDE:
      pSHPStr := SHPReadObject(hSHPHandleStr,i);
      aXIn := pSHPStr.padfX; //Array of nVertices X coordinates;
      aYIn := pSHPStr.padfY; //Array of nVertices Y coordinates;
      SHPDestroyObject(pSHPStr);

Do you have any ideas what the problem could be? Thanks a lot!
Mario Härtwig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/shapelib/attachments/20101122/0748568e/attachment.htm 


More information about the Shapelib mailing list