Comments (9)
Which version of MWGis are you using?
Can you add the code you're using that does the cutting, so we can try to reproduce it?
from mapwindow5.
Which version of MWGis are you using? Can you add the code you're using that does the cutting, so we can try to reproduce it?
MapWindow v5.6.3 with MapWinGIS v5.2.4
from mapwindow5.
OK. So you are using MW5 to cut the shapefile.
Do you experience this error with every shapefile or just with one?
And are you cutting the same shape every time or different shapes in the same shapefile?
What kind of shapefile are you cutting: line, polygon?
Can you add the shapefile so we can use it for our tests?
from mapwindow5.
OK. So you are using MW5 to cut the shapefile. Do you experience this error with every shapefile or just with one? And are you cutting the same shape every time or different shapes in the same shapefile? What kind of shapefile are you cutting: line, polygon? Can you add the shapefile so we can use it for our tests?
The shape file type I used is a polyline. and I tried a lot of times in different shapes, and different shape files.
Shape file With UTF8 encoding.
Shape file I used
from mapwindow5.
OK. So you are using MW5 to cut the shapefile. Do you experience this error with every shapefile or just with one? And are you cutting the same shape every time or different shapes in the same shapefile? What kind of shapefile are you cutting: line, polygon? Can you add the shapefile so we can use it for our tests?
The shape file type I used is a polyline. and I tried a lot of times in different shapes, and different shape files. Shape file With UTF8 encoding. Shape file I used
When I Add This line to ignore VT_BSTR. No crash happen. Perhaps this related with BSTR type.
from mapwindow5.
Hello @ningfc, and thank you for the detail you have provided.
I don't think there is anything wrong with the code here. Instead, I think this may related to another issue that I just recently resolved. If you consider this issue in the MapWinGIS Discourse, you will see that the current release is not properly handling Shapefiles that use the UTF-8 encoding. This could account for intermittent errors when trying to clear a BSTR variant, since it may not know the correct length, and is therefore trying to release memory that it doesn't own.
I have not yet submitted my code changes because, although I have now accounted for UTF-8 encoding, I have not yet accounted for Shapefiles that have other encodings. Even so, I could perhaps submit my changes so that, if you are willing, you could get my changes, rebuild the OCX, and see if the error still occurs. Would you be willing to do that?
Thank you, and Regards,
Jerry.
from mapwindow5.
Hello @ningfc, and thank you for the detail you have provided.
I don't think there is anything wrong with the code here. Instead, I think this may related to another issue that I just recently resolved. If you consider this issue in the MapWinGIS Discourse, you will see that the current release is not properly handling Shapefiles that use the UTF-8 encoding. This could account for intermittent errors when trying to clear a BSTR variant, since it may not know the correct length, and is therefore trying to release memory that it doesn't own.
I have not yet submitted my code changes because, although I have now accounted for UTF-8 encoding, I have not yet accounted for Shapefiles that have other encodings. Even so, I could perhaps submit my changes so that, if you are willing, you could get my changes, rebuild the OCX, and see if the error still occurs. Would you be willing to do that?
Thank you, and Regards,
Jerry.
Yes I will,It's my pleasure for test your new changes.
from mapwindow5.
Hello again.
Code has been checked in to the 'develop' branch to (hopefully) handle issues related to Shapefiles that use the UTF-8 encoding as specified in the Code Page file (.CPG). It will be interesting to know if this resolves your problem as well.
Thank you, and Kind Regards,
Jerry.
from mapwindow5.
Hello again.
Code has been checked in to the 'develop' branch to (hopefully) handle issues related to Shapefiles that use the UTF-8 encoding as specified in the Code Page file (.CPG). It will be interesting to know if this resolves your problem as well.
Thank you, and Kind Regards, Jerry.
I tested your Code, It works fine, saving Shapefile that use the UTF-8 encoding is OK.
My problem may cause by myself code for change variant type to VT_BSTR use VariantChangeType, So sorry. And I just resolved it. It is becouse I use VariantChangeType to a local param, but not a pointer or reference.
Thank you for your patience and help!
Regards to you.
from mapwindow5.
Related Issues (20)
- axMap1.AddLayer HOT 1
- How to create a shape file from sql query HOT 1
- mapwingis get elevation or height from shapefile HOT 1
- SampleDockWindow HOT 12
- Problem viewing base map tiles
- Exception when calling IAppContext from CustomVectorTool in template plugin project HOT 2
- ShapeEditor Plugin: add part and remove part by polygon menu cannot affect editing shape in part editor context menu
- Have any support to swip Layer Effect?
- Index out of range HOT 1
- Undo Command can not works correct At commit e566f91240b576a7b058d77c74424f0731f20b93 HOT 1
- Dynamic Projection like arcgis HOT 1
- hover longitude doesn't match raster inspection longitude HOT 1
- Hover latitude incorrect in southern hemisphere HOT 1
- Third release candidate for MapWindow5 v5.6 available
- Hover latitude incorrect in southern hemisphere HOT 1
- use snap tool when vertex edit
- Crash on startup HOT 3
- Runtime Error MapWindows v.4.8.8
- Resolution cannot be adaptive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapwindow5.