1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, mydbUnit, FBCustomDataSet, JvUIB, JvComponentBase, StdCtrls;
type CModuleInitInfos=record
public
parent:TWinControl;
//DLLName:shortString;
UIBDatabase:TJvUIBDatabase;
UIBTransaction:TJvUIBTransaction;
fieldsyears:PChar;
fieldsw: Array of PChar;
fieldswg : Array of PChar; //fields normaux et geo
segmentation:PChar;
table:PChar;
resultat:PChar;
end;
type
TForm1 = class(TForm)
JvUIBDataBase1: TJvUIBDataBase;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
t:CModuleInitInfos;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
myHandle:THandle;
name:string;
testproc: procedure(t:CModuleInitInfos);
begin
name:=IncludeTrailingPathDelimiter(ExtractFilePath(Application.exename))+'test.dll';
myHandle := LoadLibrary(pAnsiChar(name));
If myHandle = 0 then
begin
showmessage('Can''t load module! '+name);
exit;
end;
testproc:=GetProcAddress(myHandle, pAnsiChar('testproc'));
t.UIBDatabase:=JvUIBDataBase1;
testproc(t);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
JvUIBDataBase1.Connected:=true;
end;
end. |
Partager