我正在学习使用动态 DLL。我在 DLL 库中创建了 2 个函数:
DWORD fn1(VOID);
DWORD fn2(WCHAR*);
并使用 def 文件将其导出
EXPORTS
fn1
fn2
当我加载和使用 fn1 时,一切正常,但第二个导致问题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.
指针定义如下:
typedef DWORD (WINAPI *fn1)(void);
typedef DWORD (WINAPI *fn2)( WCHAR* );
并像这样加载:
fn1 first = NULL;
fn2 second = NULL;
first = (fn1) GetProcAddress( dll, "fn1" );
second = (fn2) GetProcAddress( dll, "fn2" );
你能帮我吗,什么可能导致问题 - 当我“继续”应用程序工作正常时......