Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

Commented Issue: chinese text labels sometimes casue crash [24278]

$
0
0
I use both mapwindows4.8.6 and mapwingis4.8 to label the china city names. When the number of the city name is small, it seems work fine. But when I have to deel with many city names, always it will crash after the program run a few time(like just zoomin and zoomout quickly for a few time).

In this page, gischai's last modify seems try to fix the problem I have now, but the edition he fixed is not mentioned, so I have no idea how to fix it in the mapwingis4.8.

http://www.mapwindow.org/phorum/read.php?7,12162,page=1

_(2)、MapWindow\Data\Vectors\internal\Shapefiles\AttribuTable.cs
修改了ReadTableHeader(BinaryReader reader)函数
将以下3行:
read the field name
char[] buffer = new char[11];
buffer = reader.ReadChars(11);
string name = new string(buffer);
修改为:
byte[] buffer = new byte[11];
buffer = reader.ReadBytes(11);//如果不这样做,就会在后面的读取中,造成读取移位,出错。
string name = System.Text.Encoding.Default.GetString(buffer);
//这样就可以正确读取dbf文件中各字段的中文信息了。_

At last, I attached the shp file, wish it can help to find the bug.
Comments: ** Comment from web user: robinzhong **

P.S.

I test the trouble shp file in another computer today. Win7 64bit system and bigger memory, use the same MapWindow edition,and...it seems do not have any problem now...

But in another computer(WinXP system) the crash always exist, do you think it is something wrong with the environment?

By the way, when use mapwingis to make a C# program in Visual Studio 2008,is it necessary to use "Marshal.releaseComObject()" at the end of using a com object like "MapWinGIS.Shapefile"?

Thanks,
Robin


Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>