Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

.maplib Image disappears

Fri Oct 27, 2006 2:43 am

I've got an application that gets satellite information using a timer (every 5 seconds).

The applications uses several different .maplib files. The user presses a hardware button to get the next .maplib file using.

Map1.Open("\My Documents\RAC\" & intNextFile & ".MapLib")

After scrolling through the files by pressing the hardware button the
image disappears. It doesn't raise an error.
If I then open an application ie calendar then close it the image re-appears.

Can anyone give me an idea of what I'm doing wrong and any fixes. Should I be using events instead of the timer? Is there some kind of refresh or repaint that I need to do?? Any help would be much appreciated

Many Thanks

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: .maplib Image disappears

Fri Oct 27, 2006 11:14 am

The map is repainted when you call Map.Update() or Map.UpdateAsync(). Opening another application and then closing seems like the actual paint is being done in the first place. Without seeing your entire code I can't really say what is wrong.

You should use events instead of a timer though, that is correct.
If you are using the NmeaParser you could use the OnGpsFix and OnSatellites events instead.

The reference manual for NmeaParser can be found here:
http://www.franson.com/gpstools/reference_manual.asp?comp=tools&class=NmeaParser&platform=net

Regards,
Jonas
Franson Support

Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

RE: .maplib Image disappears

Sat Nov 04, 2006 4:00 pm

Thanks Jonas
I've changed my code to use events instead of the timer. The result is the same.

Can I email you some of my code to have a look at?

When the image dissappears it throws and error onto the screen
'87:CreateDIBSection() failed'
Does this give you a clue.

I haven't upgraded to 2.3 yet, I'll try that as well.

Many thanks

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: .maplib Image disappears

Sat Nov 04, 2006 6:16 pm

The CreateDibSection error is basically an out of memory error. It failed to create the necessary bitmaps internally.
Try turning off buffered layers, by setting buffermode to DontBuffer.


Regards,
Jonas
Franson Support

Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

RE: .maplib Image disappears

Wed Nov 08, 2006 2:11 am

The image disappears when drawing an ellipse on the map. The code is straight from the ongpsfix event simplemap sample.
The only difference is my program opens different maplibs. After loading the 18th maplib the ellipse gets set to nothing and the image disappears. Like I said in the 1st post if I open another application then close it the image returns and will stay until I open another 18 maps? Any ideas.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: .maplib Image disappears

Wed Nov 08, 2006 9:54 am

Have you tried calling GC.Collect() after Map.Update()? It could be that the garbage collector isn't firing until you switch the program.

Regards,
Jonas
Franson Support

Monchopper
Posts: 14
Joined: Fri Aug 13, 2004 2:02 pm
Location: United Kingdom

RE: .maplib Image disappears

Thu Nov 09, 2006 12:47 am

That's it!! Works perfectly now.

Many thanks much appreciated!

Return to “GpsTools”