Problems w/ MapScript C#

Craig Miller craig.miller at SPATIALMINDS.COM
Mon Apr 4 13:55:13 EDT 2005


I'm no expert in Mapscript C#, but does the image need to be rewound before
draw can be called again?

--Craig


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Sean Gillies
Sent: Monday, April 04, 2005 8:04 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Problems w/ MapScript C#

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