Error: AccessViolation

Source: Internet
Author: User
Error: an error occurs in EVC4 debug mode. Error message: ErrorAccessViolation Click OK to stop the EVC statement in the file: D: programfileswindowsc1_lswce5005300promfcsrcstrcore. cpp function: LPTSTRCString: GetBuffer (intnMinBufLength): if

Error: an error occurs in EVC4 debug mode. Error prompt: Error Access Violation click OK, And the EVC stops in the file: D:/Program Files/Windows CE Tools/wce500/5300Pro/Mfc/Src/strcore. cpp function: LPTSTR CString: GetBuffer (int nMinBufLength) Statement: if

Error:

InEVC4An error occurs in debug mode.

Error message: Error Access Violation

Click OK,EVCStop in file:D:/Program Files/Windows CE Tools/wce500/5300Pro/Mfc/Src/strcore. cppFunction:LPTSTR CString: GetBuffer (int nMinBufLength)Statement in:If (GetData ()-> nRefs> 1 | nMinBufLength> GetData ()-> nAllocLength).

Solution:

1The error message is:CStringType array, because the array is relatively large, considering that it may be appliedStackToo small. HoweverStackThe problem is still not solved when the space of the array is increased. The problem is also not solved when the array size is reduced.

2Detailed debugging and DiscoveryCStringClass inGetDataPointerM_pchDataIs empty. Unknown reason!

3Consider the latest changes to find the possible causes. Because the application still runs normally one day ago!

From the stable version to the present, only one array and two macro definitions are added.

The reason is certainly here. Read the code in detail and find that macro definition usage is incorrect. A very simple error: the array is defined with a small macro, but it is incorrectly written into a large macro during initialization.

CauseCStringThe space of some members of the array variable is occupied.

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.