【发布时间】:2015-02-16 18:24:23
【问题描述】:
我正在尝试将 C++ DLL 链接到我将创建的新 C++ DLL,
我已经逐步按照下面的教程和其他许多教程进行操作,但是“GetProcAddress”函数返回 NULL “http://www.dreamincode.net/forums/topic/118076-dlls-explicit-linking/”出了点问题
这是我尝试从 DLL 调用的函数的原型:
int RemoveAllDataFile(unsigned int id);
函数返回 1,因此 DLL 加载成功。
typedef int (*funcRemoveAllDataFile) (int);
int load_dll_ARbnet(int x)
{
/* Retrieve DLL handle.*/
HINSTANCE hDLL = LoadLibrary("ArbNet2Remote.dll");
if (hDLL == NULL)
{
return 0;
}
else
{
}
/*Get the function address*/
funcRemoveAllDataFile RemoveAllDataFile = (funcRemoveAllDataFile)GetProcAddress(hDLL, "RemoveAllDataFile");
if (RemoveAllDataFile)
{
return 2;
}
else
{
return 1;
}
}
【问题讨论】:
-
查找“C++ 名称修改”
标签: c++ dll dllimport getprocaddress