我有一个c作的dll 具体说明如下
1、文件解密接口函数及参数说明:
int stdcall DecodeFile(char* InFile, //要解密的文件
char* Key, //解密的密钥
char* OutFile, //解密后的文件,在解密路径下的同名XML文件
char* Info);
//提示信息函数返回 0 成功,非0失败。
2、动态调用实例:
String jmfile = 要解密的文件路径;
String key = 要解密的文件密钥;
String strDllFile = "DecodeXMLFIle.dll"; //解密动态库文件名
DLLInst = LoadLibrary(strDllFile.c_str());
if( !DLLInst)
Application->MessageBox( "DLL装载错误", "错误信息", MB_ICONERROR); else
{ /l输入函数声明 int (stdcall DecodeFile)(char InFile,
char* Key,
char* OutFile,
char* Info);
DecodeFile = (int (__stdcall )(char InFile,
char* Key,
char* OutFile,
char* Info))GetProcAddress( DLLInst, "DecodeFile");
if (DecodeFile)
{
char outfilestr[1000] = {0};
char msgInfostr[1000] = {0};
int dRes = DecodeFile(jmfile.c_str(),key.c_str(),outfilestr,msgInfostr); if(dRes != 0)
{
String Msgstr = "提示信息:解密失败 "+AnsiString(msgInfostr);
Application->MessageBox(Msgstr, "错误信息", MB_ICONERROR);
}else
Application->MessageBox("成功", "成功", MB_OK);
}
}
FreeLibrary(DLLInst);
如何用delph声明这个函数并调用呢