Bonjour,

J'ai ajouté un gros morceau de code Delphi via un évènement beforeinstruction (j'ai essayé aussi dans un afterxmlgram) et le framework me renvoie un message d'erreur 'Défaillance irrémédiable' lorsque j'execute la DLL. En deboguant la DLL , je m'apperçoie que ça plante sur l'instruction begin de ma procédure ??? Je suppose donc que c'est dans la partie définition des variables et des fonctions qu'il y a un problème. La particularité de cette procédure est que 2 fonctions y sont définies ainsi qu'un type structuré contenant un tableau. voici le debut du code
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
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
procedure TxmGestAbs.ValidHORAIRESAfterInstruction(
  XMLInstruction: IXMLInstruction; InputDoc, OutputDoc, Input,
  Output: IXMLCursor);
 
type
    Tabenreg = record
        DateReal : Tdate;
        Prevu : array[1..1440] of byte;
        Realise : array[1..1440] of byte;
    end;
 
var
  WUser,Wnumrec : String;
  dDernierEnreg       : TDateTime;
  indG, indM, ind_finp, ind_finr, ind_debp, ind_debr : Integer;
  zDateReal : TDate;
  zEcartPrevReal : double;
  TabPlage : array[1..100] of TabEnreg;
  FlagPremierPassage : boolean;
 
 
function CalculInd(zHoraire: TDateTime): integer;
 
    var
        H,M,S,MS : Word;
    begin
        decodetime(zHoraire,H,M,S,Ms);
        result := H * 60 + M;
    end;
 
function CalculEcart(zDateReal: TDate): Double;
 
    var
        SommeHeureRea,SommeHeurePrevu : Double;
        Sol_Rea,Sol_Prevu  : word;
        indMl,indGl : integer;
 
    begin
        indGl := 0;
        indMl := 0;
        Sol_Rea := 0;
        Sol_Prevu := 0;
        repeat
        indGl := indGl + 1;
        until zDateReal = TabPlage[indGl].DateReal;
        For indMl := 1 to 1440 do
            begin
                if TabPlage[indGl].Realise[indMl] = 1 then
                    Sol_Rea := Sol_Rea + 1;
                if TabPlage[indGl].Prevu[indMl] = 1 then
                    Sol_Prevu := Sol_Prevu + 1;
            end;  }
         SommeHeureRea := encodetime((Sol_Rea DIV 60),(Sol_Rea mod 60),0,0);
         SommeHeurePrevu := encodetime((Sol_Prevu DIV 60),(Sol_Prevu mod 60),0,0);
         result := SommeHeureRea - SommeHeurePrevu;
    end;
 
begin
 
  if XMLInstruction.Name = 'DateEnreg_Maj' then
  Begin
 
  WUser := Context.Values['User'];
Quelqu'un a t-il une piste ? Pour info cette procédure tournait dans un programme CGI Delphi . Je suis en train de migrer le projet sous XMLRAD, et il s'agit maintenant d'une DLL ISAPI. La déclaration des fonctions est peut être différente ?