我正在尝试将 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;
}
}