Autor Beitrag
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Di 02.11.04 18:31 
Ich habe ein Programm geschrieben, welches icons aus dlls und
exe dateien extrahiert, funktioniert alles prima :D

nur wenn ich ein icon gespeichert habe und dann das programm beende
kommt eine Fehlermeldung:


Application Error

Exception EAccessViolation in module ICOXtract.exe at 00000000.
Access Violation at address 00000000. Read of address 00000000.


Wie behebe ich den Fehler ???
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Di 02.11.04 18:38 
mit mehr Quellcode kann dir bestimmt mindestens einer helfen!
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Di 02.11.04 19:05 
OK :D sry

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Button3Click(Sender: TObject);
begin
if fileexists(edit1.text) then if edit2.text <> '' then begin
  Icon:= TIcon.Create;
  try
    Icon.Handle := ExtractIcon(hINSTANCE,PChar(edit1.text),strtoint(edit3.text));
    Icon.savetofile(edit2.text);
    showmessage('Das Icon wurde erfolgreich extrahiert.');
  finally
    Icon.Free;
end;
end;
end;


Man kann ja icons extrahieren und alles funktioniert fehlerfrei,
wenn man aber das programm schließt ...


Helft mir bitte ... :flehan:

Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt und Beitrage zusammengefügt
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 02.11.04 22:46 
Interessant wäre hier wohl eher der Code, der noch beim Beenden des Programmes ausgeführt wird.

Btw: Warum ist eigentlich Icon global?
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 03.11.04 15:25 
da wird nix ausgeführt, das hier ist der ganze code,
ega wo ich ihn reinpacke, der fehler kommt immer.

Wie kann ich abfangen, ob es das icon mit dem index aus edit3.text in der datei
edit1.text gibt ?

weil da kommt so ein ähnlicher fehler, falls es nicht der fall sein sollte
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 03.11.04 18:05 
F34r0fTh3D4rk hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
Icon.Free					

Delphi denkt wohl das ist Application.Icon oder Self.Icon. Dann ist ja auch klar warum 'ne Fehlermeldung kommt.

_________________
Ciao, Sprint.
F34r0fTh3D4rk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mi 03.11.04 19:13 
aha, deshalb wurde auch immer das icon meines progs geändert,

danke funktioniert jetzt alles bestens,


daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanke !!! :party:




Hätte ich aber selbst drauf kommen müssen :oops: