我是在 C++ 中创建 DLL 库的新手,这是我的代码
//header.h
class A
{
virtual int funct()=0; //Pure virtual function
};
项目 B(在编译时生成 DLL)
#include "header.h"
#define B_DLL __declspec( dllexport )
class B_DLL B: public A
{
//Definitions of the 3 pure virtual functions are here
int funct()
{
//definition go here
}
};
现在我创建一个类 A 的实例并调用funct()然后我收到错误
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.
如何使用调用约定_cdecl或_stdcall来解决这个问题。我搜索了很多但找不到确切的解决方法请帮助我解决这个问题
提前致谢