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调用不协调。
只需要更改调用约定就能解决此错误。
dll调用分为两种:
1.代码控制调用约定
typedef HRESULT(__stdcall*CommBase)(CCommBase**);
2.由编辑器控制调用约定
typedef HRESULT(*CommBase)(CCommBase**);
工程->属性->c/c++->高级->调用约定