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
|
library ED_DLL;
uses
ShareMem, Dialogs, SysUtils,
Classes,
Windows,
//unitdll in 'unitdll.pas';
FM_Main in 'FM_Main.pas'; //TF_main est la form de mon exe qui contient les fonction que je vais appeler depuis ma dll
{$R *.res}
procedure ExportToFileMultiple_NEW(ExportType : TFileType; refcon : String; DestinationType: TDestType;
MajStatuts,choixRepertoire : Boolean;
RepertoireCible : String); stdcall; external 'exportdeals.exe';
procedure ExportToFileUnitaire_NEW(refcon, type_du_deal : String; MajStatuts, choixRepertoire : Boolean;
RepertoireCible: String); stdcall; external 'exportdeals.exe';
function GetTypeDeal(refcon : string): string; stdcall; external 'exportdeals.exe';
procedure ExportToFile(ExportType : TFileType; Listrefcon : TStringList; DestinationType: TDestType;
MajStatuts,choixRepertoire : Boolean; RepertoireCible : String;
CreerUnitaire : Boolean; const F_Main: TF_Main); stdcall;
var
i : integer;
type_du_deal : String;
//F_Main: TF_Main;
begin
for i := 0 to Listrefcon.Count-1 do
begin
type_du_deal:= F_Main.GetTypeDeal(Listrefcon[i]);
if((type_du_deal='CDS') or (type_du_deal='Swap de change') or (type_du_deal='Change spot')
or (type_du_deal='Change terme')) then
begin
if (not (CreerUnitaire)) then
F_Main.ExportToFileMultiple_NEW(ExportType, Listrefcon[i] , DestinationType, MajStatuts,
choixRepertoire, RepertoireCible)
else
F_Main.ExportTofileUnitaire_NEW(Listrefcon[i], type_du_deal, MajStatuts,
choixRepertoire, RepertoireCible);
end
else if ((type_du_deal='Option listée et future') or (type_du_deal='CFD')
or (type_du_deal='TRS')) then
F_Main.ExportToFileMultiple_NEW(ExportType, Listrefcon[i] , DestinationType,
MajStatuts, choixRepertoire, RepertoireCible)
else if ((type_du_deal='TCN') or (type_du_deal='Swaps de taux') or (type_du_deal='Obligation') or
(type_du_deal='VarSwap') or (type_du_deal='Obligation convertible') or
(type_du_deal='Option sur CDS') or (type_du_deal='Option de Change') or
(type_du_deal='Option OTC') or (type_du_deal='Dividend Swap') or (type_du_deal='Outperformance') or
(type_du_deal='CapFloor') or (type_du_deal='Equity Swap') or (type_du_deal='Pension JJ')) then
F_Main.ExportTofileUnitaire_NEW(Listrefcon[i], type_du_deal, MajStatuts, choixRepertoire,
RepertoireCible)
else
MessageDlg('Le type du deal n est pas valide', mtError, [mbOk], 0);
end;
end;
exports
ExportToFile;
begin
end. |
Partager