Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.... 此错误的解
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.
?
函數(shù)定義的調(diào)用規(guī)則,和實(shí)際的調(diào)用規(guī)則不同。如 編譯器默認(rèn)的是__cdecl,而__stdcall 類型的函數(shù)卻用了 __cdecl 的調(diào)用規(guī)則,由于編譯時(shí)不會(huì)報(bào)錯(cuò),結(jié)果出現(xiàn)了運(yùn)行時(shí)異常。
所以把在函數(shù)定義中進(jìn)行設(shè)置調(diào)用規(guī)則即可解決此問題。
如:??typedef void?(__stdcall?Foo)(int?a);
總結(jié)
以上是生活随笔為你收集整理的Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.... 此错误的解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言目录操作 (Linux/Unix)
- 下一篇: skip与direct模式区别 ,他们