Run-Time Check Failure #0
来源:互联网 发布:虚拟歌姬绘画软件 编辑:程序博客网 时间:2024/05/21 09:27
在VC中编写多线程程序,特别是调用DLL时经常碰到如下错误:
Run-Time Check Failure #0 - 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.
这是怎么回事,如何解决?
答:函数定义的调用规则,和实际的调用规则不同。如 __stdcall 类型的函数却用 __cdecl 的调用规则。极可能是其中一个函数指针有问题。
编译器默认的是__cdecl,而函数指针是由void*传进去的__stdcall方式,由于编译时不会报错,结果出现了运行时异常。
所以把在函数定义中进行设置调用规则即可解决该问题。如:
typedef bool(__stdcall GetFirstMessage)(char *, int *, char *, int, int *);
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure
- Run-Time Check Failure #0错误
- Run-Time Check Failure #0 - 错误问题
- Run-Time Check Failure #0错误
- HTMLDocument3 getElementById Run-Time Check Failure #0
- Run-Time Check Failure #0 错误
- Run-Time Check Failure #0 错误小结
- Run-Time Check Failure # 2
- jquery表格增加删除行操作
- 一键编译Boost批处理
- 双击表格td进行编辑
- C程序(求最长子串、预编译指令、用函数指针对日期排序、用va_list对字符串排序、时间函数、实心空心菱形)
- 大数相乘
- Run-Time Check Failure #0
- Crypto++简要入门
- 用Trie树实现词频统计和单词查询
- poj 2828 Buy Tickets
- java7新特性之一 7大新功能
- awk常用命令
- QSqlTableModel
- 绝好的数据库语言SQL教程!!!
- 红旗lunix安装VMWare Tools