DLL求解释
本帖最后由 乐yi忘忧 于 2012-6-1 13:18 编辑求解释这段代码:unit Common_Unit; usesSysUtils, Classes, DB, ADODB, Windows, Dialogs, Forms;typeTWriteIni = procedure(FileName,Section,Indet,Values: string); stdcall;//写Ini文件TReadIni = function(FileName,Section,Indet: string):string; stdcall;//读Ini文件function SQLDataSet(sqlText: string; ADOConn: TADOConnection): TDataSet; stdcall; external 'SQLOperator.dll'; //静态调用DLLprocedure SQLExecute(sqlText: string; ADOConn: TADOConnection); stdcall; external 'SQLOperator.dll'; // 执行SQL的函数function SQLSearch(sqlText: string; ADOConn: TADOConnection): Boolean; stdcall; external 'SQLOperator.dll'; //静态调用DLLfunction DBConFileName(FileName: string): string;function FileName: string;varDLLHandle: THandle;WriteIni: TWriteIni;ReadIni: TReadIni;LoginUser: string; //登录时记录的登录编号,全局变量Flag: Integer; //入学时间和毕业时间的标志 ,全局变量implementationfunction DBConFileName(FileName: string): string;begintry //动态加载DLL,DLL中包含了读取INI文件的函数 DLLHandle := LoadLibrary('CommInfo.dll'); @ReadIni :=GetProcAddress(DLLHandle,'ReadIni'); if @ReadIni <> nil then Result := ReadIni(FileName,'BDConn','DBConFileName');finally FreeLibrary(DLLHandle);//释放DLLend;end;function FileName: string;//搜索执行文件下的INI文件读取数据库的连接路径beginResult := ExtractFilePath(Application.ExeName) + 'ConfigDB.ini';end;end. 从CommInfo.dll获取ReadIni函数,并将函数首地址赋值给函数变量ReadIni 我表示看不懂,抢沙发的 好像很复杂。。。。我不会 {:2_28:}看不懂啊 看一看 看一看
页:
[1]