Access violation at address 004046B2
Bonjour à tous,
Je m'arrache les cheveux depuis quelques jours car j'ai l'erreur suivante qui apparait :
Citation:
Access violation at address 004046B2
Cette erreur est apparue depuis que j'appelle une forme dans la fiche principale
Appel de la forme:
Code:
1 2 3 4 5 6 7 8
| rocedure TFormPrincipale.eventFin(Sender: TObject);
var
begin
Application.Createform(TForm1, Form1);
Form1.ShowModal; |
Il s'agit d'une forme simple des images + 1 bouton pour fermer la forme
Unité de ma forme :
Code:
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
|
unit MessageToDisplay;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, StdCtrls, jpeg, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
img3: TImage;
img2: TImage;
img1: TImage;
btn1: TButton;
lbl1: TLabel;
procedure FormCreate(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
position := poDesktopCenter;
end;
end. |
En deboggant, l'erreur apparait à la ligne en rouge du module Controls
Code:
1 2 3 4 5 6 7 8 9 10 11
| procedure TControl.WMLButtonUp(var Message: TWMLButtonUp);
begin
inherited;
if csCaptureMouse in ControlStyle then MouseCapture := False;
if csClicked in ControlState then
begin
Exclude(FControlState, csClicked);
if PtInRect(ClientRect, SmallPointToPoint(Message.Pos)) then Click;
end;
DoMouseUp(Message, mbLeft);
end; |
Quelqu'un pourrait-il m'aider à résoudre ce problème
Merci d'avance Marsup