Invalid Address specified to RtlValidateHeap( 003A0000, 00E91F78 )

caojunjie 2003-02-27 04:04:21
这里有一个exe和一个dll.
'CIved' is a class in exe.
'ITER()' and 'IVEDClear()' are functions in dll. 'ITER()' allocate some memory and 'IVEDClear()' clear memory allocated by 'ITER()'.
可以正确执行的代码如下:

for(int i=0; i<fn1n.size(); ++i){
CIved cived;

line1: ITER(fn1n[i],fn2n[i],fn3, logfile);
line2: IVEDClear();

line3: cived.import(fn1[i], fn3);
line4 : cived.export(fn1n[i]);
}

一切正常,没有内存问题.

但是当我把line1 and line2移到 line3 and line4后面执行,当退出一次for循环,cived析构时,MS viual c++ 6.0给出错误如下:
HEAP[IVED_0_1.exe]: Invalid Address specified to RtlValidateHeap( 003A0000, 00E91F78 )
因其错误的代码如下:

for(int i=0; i<fn1n.size(); ++i){
CIved cived;

line3: cived.import(fn1[i], fn3);
line4 : cived.export(fn1n[i]);

line1: ITER(fn1n[i],fn2n[i],fn3, logfile);
line2: IVEDClear();

}
盼望任何帮助。
...全文
56 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧