运行时dll出错,然后在调用dll文件时就会提示 找不到此文件,怎么回事呀?
这是主程序里调用dll的函数。
bool __fastcall TForm1::RunExFile(char * dllname, char * user) // 外部扩充调用{ /* 入口格式:调用dll文件名,传递用户名 */ bool OK; if(FileExists(dllname)) { boolean PrevValue = IsLibrary; //C++ Builder - Exception 'Need call dxFinalizeGDIPlus before free library!' when using DX components in a DLL hInstance=LoadLibrary(dllname); if(hInstance) { (FARPROC &) DllWin=GetProcAddress(hInstance,"DllWin"); if(DllWin) { OK=DllWin(user); } else { ShowMessage(" 不能找到函数入口,请重新安装本程序。"); } } else { ShowMessage("不能载入DLL文件,请重新安装本程序。"); } FreeLibrary(hInstance); IsLibrary = PrevValue; //C++ Builder - Exception 'Need call dxFinalizeGDIPlus before free library!' when using DX components in a DLL } else { ShowMessage(" 相应模块文件丢失,请重新安装本程序。"); } return OK;}//---------------------------------------