Coder Social home page Coder Social logo

Comments (9)

pmeems avatar pmeems commented on August 16, 2024

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.

ningfc avatar ningfc commented on August 16, 2024

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.

pmeems avatar pmeems commented on August 16, 2024

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.

ningfc avatar ningfc commented on August 16, 2024

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.

ningfc avatar ningfc commented on August 16, 2024

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.
image

from mapwindow5.

jerryfaust avatar jerryfaust commented on August 16, 2024

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.

ningfc avatar ningfc commented on August 16, 2024

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.

jerryfaust avatar jerryfaust commented on August 16, 2024

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.

ningfc avatar ningfc commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.