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;
}
}