Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Neue Zugriffsverletzung... (https://www.delphipraxis.net/21481-neue-zugriffsverletzung.html)

faux 3. Mai 2004 17:22


Neue Zugriffsverletzung...
 
So, jetzt hab ich das Forschleifenzugriffsverletzungsproblem (was für ein Wort.. *gg*) gelöst...
Doch jetzt kommt eine neue:

Delphi-Quellcode:
var
  Form31: TForm31;
  NIM: TNotifyIconData;
  OpenUIN: TList;
  UINName, UINList: TStringList;
  Status: TICQStateType;
  SSL: TOnChangeResponse;
Delphi-Quellcode:
procedure TForm31.Senden1Click(Sender: TObject);
var
  i, a, b: Integer;
  open: boolean;
  {OpenUIN: TList;
  UINName: TStringList;}
begin
  open := true;
  if UINName.Count > 0 then
    for i := 0 to UINName.Count - 1 do
      if UINList.Strings[ContactList.ItemIndex] = UINName.Strings[i] then
      begin
        open := false;
        a := i;
      end;
  if open then
  begin
    UINName.Add(UINList.Strings[ContactList.ItemIndex]);
    b := OpenUIN.Add(TChat.Create(Self));
    with TChat(b) do
    begin
      Log.Tag := b; //Hier tritt die Exception auf
      Tag := StrToUIN(UINList.Strings[ContactList.ItemIndex]); //kommentiere ich die Log.Tag := b weg, dann tritt sie hier auf..
      if Tag = 0 then //Kommentiere ich weiter, läuft die exception weiter...
      begin
        Free; //...
        MessageDlg('Fehler in der Konatktliste.'+#10+'Die UIN von '''+ContactList.Items.Strings[ContactList.ItemIndex]+''' ist ungültig.', mtError, [mbOK], 0);
      end
      else
        Show;
    end;
  end
  else
    TChat(OpenUIN.Items[a]).Show;
end;
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt CQ.exe ist eine Exception der Klasse EAccessViolation aufgetreten. Meldung: 'Zugriffsverletzung bei Adresse 004833A1 in Modul 'CQ.exe'. Lesen von Adresse 0000030C'. Prozess wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen.
---------------------------
OK
---------------------------

Die Leseadresse (im Bsp 0000030C) variiert jedoch von Aufruf zu Aufruf... und sie ist nicht 00000000... *gg*

Verdammte procedure TForm31.Senden1Click(Sender: TObject).... :twisted:

kiar 3. Mai 2004 17:28

Re: Neue Zugriffsverletzung...
 
der fehler sollte hier stecken
Delphi-Quellcode:
 UINName.Add(UINList.Strings[ContactList.ItemIndex]);
    b := OpenUIN.Add(TChat.Create(Self));
    with TChat(b) do

faux 3. Mai 2004 17:32

Re: Neue Zugriffsverletzung...
 
Was stimmt hier nicht?
darf man das nicht so machen??

faux 3. Mai 2004 17:36

Re: Neue Zugriffsverletzung...
 
Fehler gefunden:
b ist ein Integer ich brauche einen pointer. Also: OpenUIN.Items[b]


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz