动态调用dll问题

来源:互联网 发布:2015广告主投放数据 编辑:程序博客网 时间:2024/06/04 23:29

    使用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*);