Microsoft Visual Studio C run-Time library detected an error in Xx.exe

Source: Internet
Author: User

Many times before this problem, and then after the resolution will appear on the forgotten how to do, this time record.

I've had this kind of error several times because of the qstring to const char* in Qt. My approach is to have a function tostring () to std::string

1 std::string  myprocessobject::tostring (QString strraw)2{3     return std::string((constChar *) strraw.tolocal8bit ()); 4 }
ToString ()

This is done because there are sometimes Chinese path problems.

And then every time I need to pass in the const char*, I'm ToString (QString). C_STR (), so that the direct parameter error occurs. The workaround is to:

String str=tostring (QString);

Then the incoming STR.C_STR () is available, the specific reason is unclear.

Microsoft Visual Studio C run-Time library detected an error in Xx.exe

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.