本帖最后由 jtwc 于 2022-4-21 17:54 编辑
各位老师,C++动态加载dll失败,是啥原因呢?谢谢了
dll源码https://www.52pojie.cn/thread-1180359-1-1.html
出错如下图:[C++] 纯文本查看 复制代码 #include <stdio.h>
#include <iostream>
#include <windows.h>
using namespace std;
typedef int(*Func)(long, string, long, long);
int main()
{
Func scan_data;
HMODULE dllheader;
dllheader = LoadLibrary("F:\\test.DLL");
if (dllheader == NULL)
{
printf("dll加载失败!");
}
else
{
scan_data = (Func)GetProcAddress(dllheader, "Scan_data");
if (scan_data == NULL)
{
printf("获取函数句柄失败!");
}
else
{
printf("%x", scan_data(7128, "AF 00 00 00 14 00 00 00 CE 48", 0, 0));
}
}
FreeLibrary(dllheader);
system("pause");
return 0;
} |