Home > Database > Mysql Tutorial > body text

Error:Access Violation

WBOY
Release: 2016-06-07 15:50:10
Original
1377 people have browsed it

错误: 在 EVC4 调试模式下,出现错误。 错误提示: Error Access Violation 点击确定后, EVC 停止在文件: D:/Program Files/Windows CE Tools/wce500/5300Pro /Mfc/Src/strcore.cpp 的函数: LPTSTR CString::GetBuffer(int nMinBufLength) 中的语句: if

 

错误:

EVC4调试模式下,出现错误。

错误提示:Error Access Violation

 

点击确定后,EVC停止在文件:D:/Program Files/Windows CE Tools/wce500/5300Pro /Mfc/Src/strcore.cpp 的函数:LPTSTR CString::GetBuffer(int nMinBufLength)中的语句:if (GetData()->nRefs > 1 || nMinBufLength > GetData()->nAllocLength)

 

解决问题:

 

1 出现错误的是一个CString 类型的数组,因为数组比较大,考虑到可能是应用的stack太小。但将stack的空间增大,问题仍然没有解决;将数组的大小减小,同样问题没有解决。

 

2 详细调试发现CString类在GetData时,指针m_pchData为空。原因不明!

 

3 考虑最近的修改,寻找可能引起此问题的原因。因为一天前,此应用还是可以正常运行的!

从稳定的版本到现在,只增加了一个数组和两个宏定义。

 

原因肯定在这里,详细阅读代码发现,宏定义使用错误。很简单的错误:数组是用小的宏定义的,初始化时却错误的写成大的宏。

导致一个CString 数组变量的部分成员的空间被占用。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!