この例をMSDNで見つけて使用しようとしていますが、パラメーターで機能させるのに問題があります(http://msdn.microsoft.com/en-us/library/ms686944(VS.85).aspx)
以下は私が使用しようとしているコードであり、私が呼び出そうとしているメソッドには4つのパラメーター(CString a、CString b、CString c、BOOL d)があります。
extern "C" __declspec(dllexport) int __stdcall
ImportFile(CString a, CString b, CString c, BOOL d)
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
// Get a handle to the DLL module.
hinstLib = LoadLibrary(TEXT("C:\MyDll.dll"));
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
ProcAdd = (MYPROC) GetProcAddress(hinstLib, "TestFunction");
// If the function address is valid, call the function.
if (NULL != ProcAdd)
{
fRunTimeLinkSuccess = TRUE;
(ProcAdd) (a, b, c, d);
}
// Free the DLL module.
fFreeResult = FreeLibrary(hinstLib);
}
// If unable to call the DLL function
if (!fRunTimeLinkSuccess)
return -1;
return 0;
}
私が間違っていることについて何か考えはありますか?前もって感謝します!!!