使用LoadLibraryA(),GetProcAddress()函数动态调用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.
意思是调用方式不匹配。当调用C++的dll时,使用类似下面的方式
typedef int (WINAPI *int_Func)(int*);
当调用C的dll时,使用类似下面的方式
typedef int (*int_Func)(int*);