Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 24.09.05 19:38 
Also ich hab ne Zugriffsverletzung:

---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt transmitter.exe ist eine Exception der Klasse EAccessViolation aufgetreten. Meldung: 'Zugriffsverletzung bei Adresse 00E61336. Schreiben von Adresse 00000001'. Prozess wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen.
---------------------------
OK Hilfe
---------------------------

Diese Fehlermeldung ist ja total aussagekräftig :wink: :wink:

In der Hilfe hab ich auch schon nachgeschaut aber was da steht, naja... nix brauchbares.

Wenn wenigstens gezeigt würde in welcher codezeile der Fehler auftritt.
Das Prob ist dass die Funktion die aufgerufen wird aus einer DLL importiert wird und deshalb eine Lokalisation des Fehlers nicht möglich ist. Und komisch is auch wenn ich die Funktion in ein anderes Programm einbaue dann funzt alles. :gruebel:

Was soll ich nun tun? :flehan:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ripper8472
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 114

Win2k (und wenn ich nen Zweitrechner haette, auch eine Linux Distri)

BeitragVerfasst: Sa 24.09.05 19:44 
koennte an einer unsachgemaessen benutzung von pointern oder dynamischem speicher liegen.
PLuS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98

Win XP, Suse Linux 9.0
D5 Standard, D2005 Personal; Perl; PureBasic
BeitragVerfasst: Sa 24.09.05 19:48 
Poste doch mal einfach ein bisschen Code von dir!

Deine Beschreibung hat glaub ich zwar jeder verstanden, nur helfen wird dir da keiner können!


MfG
PLuS
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 25.09.05 16:30 
Titel: Zugriffsverletzung
Ich benutze keine Pointer und auch dynamischen Speicher. Ich benutze nur 2 Stringlists und die werden auch sachgemäß kreeirt (list:=tstringlist.create;).

Ich werd mal nen bissl Code posten. Bin grad auf Arbeit und hab ihn grad nich da.

CU Koller

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 25.09.05 17:17 
Titel: XY
Also hier meine Funtkion

ausblenden volle Höhe Delphi-Quelltext
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:
var i,i2:integer; hash_ids:tstringlist;  schein_hashes : array[1..30] of string;
hilfsliste:tstringlist;

randomize;
hash_ids:=tstringlist.create;
for i := 0 to hashliste.count-1 do
begin
i2:=random(30)+1;
hash_ids.Add(inttostr(i2));
end;

hilfsliste:=tstringlist.create;

for i := 1 to 30 do
begin
hilfsliste.add(schein_hashes[i]);
end;

for i := 0 to hash_ids.count-1 do
begin
hilfsliste.strings[(strtoint(hash_ids[i])-1)]:=hashliste.Strings[i];
end;

hilfsliste.savetofile(extractfilepath(paramstr(0))+'cryptix.ctf');

for i := 0 to hash_ids.count-1 do
begin
hash_ids.Strings[i]:=inttostr(strtoint(hash_ids[i])*1912);
end;

hash_ids.SaveToFile(extractfilepath(paramstr(0))+'ids.ctf');
hilfsliste.free;
hash_ids.free;
result:=true;


//Das sind nur Auszüge aus dem Code. Ich bin mir sicher, dass dort der Grund für die Zugriffsverletzung liegt.
//Wie gesagt, ich habe die Kommentare weggelasse, also wenn kein Wunder wenn ihr denn Sinn nicht versteht.
//In meinem ersten Posting habe ich mich geirrt.
//Unzwar: Wenn ich die Funktion aus der DLL importiere kommt diese dumme Zugriffsverletzung.
//Wenn ich diese Funktion direkt in mein App einbaue, dann funzt alles. Dat versteh ich nich.


Hoffe auf Lösungsvorschläge :flehan: :flehan:
PLuS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98

Win XP, Suse Linux 9.0
D5 Standard, D2005 Personal; Perl; PureBasic
BeitragVerfasst: So 25.09.05 18:19 
Also für mich sieht das so aus, als hättest du deine "hashliste" nicht initialisiert!

Du benutzt sie zwar zweimal:
ausblenden Delphi-Quelltext
1:
for i := 0 to hashliste.count-1 do					


und
ausblenden Delphi-Quelltext
1:
hilfsliste.strings[(strtoint(hash_ids[i])-1)]:=hashliste.Strings[i];					


Ich kann sonst keinen Fehler finden, da du auch ziehmlich viel vom Code rausgeschnitten haben musst! Man kann nicht mal dem Code entnehmen, ob das eine Procedure ist, oder die Listen in verschiedenen Procedures initialisiert werden!


MfG
PLuS

_________________
Der letzte macht die Tür zu!
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Mo 26.09.05 12:53 
Kannst du nicht per F7 durch das Programm "steppen" ?
Sinspin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1341
Erhaltene Danke: 120

Win 10
RIO, CE, Lazarus
BeitragVerfasst: Mo 26.09.05 13:36 
sieht dein quelltext nur hier so blöd formatiert aus oder ist der immer so unübersichtlich?
ich schließ mich erstmal an, wenn du hilfe haben möchtest dann solltest du vieleicht ein bisschen mehr code rausrücken. denn es ist wirklich nicht ersichtlich ob es sich an einigen stellen um fehler handelt oder du nur etwas weggelassen hast.
dann würde mich mal interessieren ob du schonmal dll's erstellt hast und alle funktionen daraus problemlos funktioniert haben. und ob du in deiner aktuelle dll noch anderen funktionen hast bei denen keine probleme auftauchen.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 26.09.05 18:42 
Titel: Z
Also das ist meine erste DLL.

Alle anderen Funktionen funzen.

Mit f7 das probier ich gleich aus.

Und wegen der hashliste:

ausblenden Delphi-Quelltext
1:
function SaveHashes(Hashliste:Tstrings) : boolean;					


Also brauch man die doch nicht zu initialisieren oder?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot