调用DLL函数时报告堆栈异常的解决方法

The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.


解决方法:

1. VC6

  工程->设置->C/C++->工程选项

  直接把 /GZ 给去掉

 

2. VC.NET

   项目属性->C/C++->代码生成->基本运行时检查->选择Default

   (这里的/RTC会检查堆栈,去掉这个标志就行了_

   


 

posted @ 2011-06-20 16:54  Master HaKu  阅读(1052)  评论(1编辑  收藏  举报