Autor Beitrag
BastardOp
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41

Windows XP Prof. SP2
Delphi 7 PE Delpi 2005 PE
BeitragVerfasst: So 05.06.05 13:21 
Hallo

also ich hab gerade was geproggt. Wenn ich bei dem Programm auf einen TLIstView Eintarg klicken wird eine neus Form geöffnet und dort werden den die Einträge der T ListView angezeigt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
rocedure TForm1.ListView4SelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);
var item2:TListItem;
begin
  Form3.show;
  
 if ListView4.Selected <> nil then

  begin
    Item2:=ListView4.Selected;
    form3.Edit1.Text := Item2.subItems[0];
    form3.Edit2.Text := Item2.subitems[1];
    form3.Edit3.Text:=item2.subitems[2];
    form3.Edit4.Text:=item2.caption;
    form3.Memo2.text := Item2.subitems[3];


end;

end;


so sieht der code zum öffnen des Forms aus.

Soweit klappt auch alles aber wenn ich nun das neu geöffneten Form schleiße und das gesammte Programme beende kommt immer folgender Fehler:

Zitat:

Im Projekt trade.exe ist eine Exeption der Klasse EAccessViolation aufgetreten. Meldung:'Zugriffsverletzung bei Adrese 00000000. Lesen von Adresse 00000000'. Prozess wurde angehalten. Mit Einzenlne Anweisung oder Start fortsetzen.


Ich arbeite noch nicht so lange mit Delphi und nutze Version 7 PE.

Ich hoffe ihr könnt mir helfen was ich fladch mache. Der Fehler kommt nur wenn ich des neue Form geöffnet hatte sonst nicht.

MfG
BastardOp
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 05.06.05 13:44 
user profile iconBastardOp hat folgendes geschrieben:
Hallo
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
    form3.Edit1.Text := Item2.subItems[0];
    form3.Edit2.Text := Item2.subitems[1];
    form3.Edit3.Text:=item2.subitems[2];
    form3.Edit4.Text:=item2.caption;
    form3.Memo2.text := Item2.subitems[3];



Du setzt hier vorraus, dass item2 4 Subitems hat, was nicht sicher sein muss. Du könntest erts mal ermitteln ob item2 überhaupt so viele Subitems hat (item2.Count, wahrscheinlich).

_________________
Programmers never die, they just GOSUB without RETURN
BastardOp Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41

Windows XP Prof. SP2
Delphi 7 PE Delpi 2005 PE
BeitragVerfasst: So 05.06.05 18:27 
Item2 hat schon soviele Subitems, das is ja auch nicht das problem die übertragung von form1 in form3 funzt ja ohne porblem nur wenn ich das Programm danach schließe kommt immer die oben genannte Fehlermeldung
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Mo 06.06.05 11:17 
sowas kann auftreten, wenn du dynamisch erzeugte objekte nicht freigegeben hat.
guck mal, ob du genauso viel create wie free in deinem projekt hast :D

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
BastardOp Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 41

Windows XP Prof. SP2
Delphi 7 PE Delpi 2005 PE
BeitragVerfasst: Mo 06.06.05 13:53 
Hi
kann deinen Hinweis grad net überprüfen da ich noch in der Schule bin :?
Aber soweit ich mich erinnern kann hab ich keine create oder fre befehlen in dem programm verwendet. Wie gesagt bin noch n00b und arbeite mit einfachen mitteln :)
Aber trotzdem schonmal thx