Einzelnen Beitrag anzeigen

Benutzerbild von dataspider
dataspider
Online

Registriert seit: 9. Nov 2003
Ort: 04539 Groitzsch
1.350 Beiträge
 
Delphi 11 Alexandria
 
#1

sporadische Exceptions bei TForm.SetFocus

  Alt 28. Jul 2021, 07:53
Hallo

Ich erhalte von MadExcept immer mal einen Fehlerbericht, z.B.:

exception class : EAccessViolation
exception message : Zugriffsverletzung bei Adresse 006BCFBF in Modul 'AIS3.exe'. Lesen von Adresse 00000040.

006bcfbf +1cb AIS3.exe Vcl.Forms TCustomForm.SetFocusedControl
005c66e7 +21f AIS3.exe Vcl.Controls TWinControl.WndProc
008f0118 +1ac AIS3.exe cxControls TcxControl.WndProc
00bd963d +029 AIS3.exe cxGridCustomView TcxGridSite.WndProc
005c60d0 +02c AIS3.exe Vcl.Controls TWinControl.MainWndProc
004ff5c0 +014 AIS3.exe System.Classes StdWndProc
77bd0d94 +034 ntdll.dll KiUserCallbackDispatcher
033900f2 +066 AIS3.exe RWForms 1399 +8 TRWForm.doMouseActivate
033904ef +0ef AIS3.exe RWForms 1586 +26 TRWForm.WMMouseActivate

Hier die betreffende Routine
Delphi-Quellcode:
procedure TRWForm.doMouseActivate(AControl: TControl);
begin
  if (not WinControlValid(Self)) or IsDestroying then
    Exit;
  FLastClickedControl := AControl;
  if (Self <> rwScreen.ActiveForm) then
  begin
    try
      if (Visible and CanFocus) then
        SetFocus; // Hier wird Exception ausgelöst!
    except
      ///// Nur vorübergehend
    end;
    rwScreen.ActiveForm := Self;
  end;
end;
Was kann noch die Ursache für eine Exception sein?
Ich teste doch schon auf Visible, CanFocus und csDestroying...
Wichtig, ich benutze embedded Forms...

Frank
Frank Reim

Geändert von dataspider (28. Jul 2021 um 08:08 Uhr)
  Mit Zitat antworten Zitat