DLL函数调用的运行时错误

来源:互联网 发布:云计算时代cdn变化 编辑:程序博客网 时间:2024/05/08 02:42
今天帮人调个程序,在调用一个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.

原因是这样的:
调用这个DLL的工程是Unicode的,而DLL本身是多字节版的,在调用的那个函数中有个参数,LOGFONT,它在两个版本中有不同的定义,所以就出现了如上的调用冲突。
原创粉丝点击