Bonjour,
Dans ma DLL ecrite en delphi j'ai une procedure qui appelle une fonction de mon exe ecrite en delphi aussi. Ca compile donc pas de problème de visibilité, mais à l'éxecution il m'envoi une erreur de type EAccessviolation.

Je donne le code de la fonction qui est dans l'exe et qui est appelée depuis ma DLL.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
unit FM_Main;
 
interface
 
uses
{.....}
type
  TF_Main = class(TForm)
     ADOQuery1: TADOQuery;
     ADOConnectionSophis: TADOConnection;
     {et d'autres variables, fonctions et procedures}
end;
var
 {des variables...}
 procedure ExportToFile(...); stdcall; external NomDLL; // la fonction qui appele GetTypeDeal depuis la DLL
 function GetTypeDeal(refcon : string;  F_Main: TF_Main): string;  stdcall;
 exports GetTypeDeal;
 
implementation
function GetTypeDeal(refcon : string;  F_Main: TF_Main): string;
begin
   F_Main.AdoQuery1 := TADOQuery.Create(Application);
   F_Main.AdoQuery1.Connection       := F_Main.ADOConnectionSophis;
   F_Main.ADOQuery1.SQL.Text := 'select sicovam from histomvts where refcon ='+ refcon ;
   F_Main.ADOQuery1.open;
   F_Main.ADOQuery1.SQL.Text:='select ADI_GETALLOTEMENT(' + F_Main.ADOQuery1.FieldByName('SICOVAM').AsString + ') as colonne from dual';
   F_Main.ADOQuery1.open;
   Result := F_Main.ADOQuery1.FieldByName('colonne').AsString;
end;
{ici l'implementation d'autre fonctions et procedures de TF_MAIN TF_Main.f, TF_Main.g ... }
end.
Merci d'avance les gas