Problems w/ MapScript C#

Sean Gillies sgillies at FRII.COM
Mon Apr 4 08:03:39 PDT 2005


On Apr 3, 2005, at 9:49 PM, Ian Erickson wrote:

> I've successfully built the C# Mapscript assembly, and have
> successfully
> written code that generates an image file to disk.  Everything seems to
> work just fine until I make repeated calls to the map.draw() function.
> I get the following exception after 3 or 4 calls to the private member
> function drawMapImage():
>
> System.NullReferenceException: Object reference not set to an instance
> of an object.
>    at mapscriptPINVOKE.mapObj_draw(IntPtr jarg1)
>    at mapObj.draw()
>    at SimpleMap.Form1.drawMapImage()
>

[snip]

Ian,

When you say "repeated calls", do you mean that these are sequential or
concurrent?

I (with no other info) interpret the exception to be saying that
"jarg1" is Null.  As far as I can tell from the C# mapscript_wrap.c
file this is a reference to the mapObj.  Are you destroying your mapObj
instance in the middle of your calls to drawMapImage()?

Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the MapServer-users mailing list