Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Zugriffsverletzung bei Adresse ' ' in Modul (https://www.delphipraxis.net/184839-zugriffsverletzung-bei-adresse-modul.html)

Rippo 24. Apr 2015 11:51

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
Delphi-Quellcode:
function RegPath: String;
begin
  Result := ExtractFileName(ChangeFileExt(ParamStr(0), '.ini'));
end;
diese

DeddyH 24. Apr 2015 11:54

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
Ganz sicher? Ich wüsste nicht, was in dieser Zeile zur AV führen könnte.

Jasocul 24. Apr 2015 12:00

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
Ich habe das mal bei mir getestet, weil ich mir nicht vorstellen konnte, dass es dabei einen Fehler geben kann.
Ich bekomme keinen Fehler.

Rippo 24. Apr 2015 12:01

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
hmm ...ich überprüfe bei mir mal alles

DeddyH 24. Apr 2015 12:12

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
Etwas ganz anderes: wenn die Prozeduren Instanzen einer Formularklasse erwarten, wäre es da nicht wesentlich eleganter, gleich Methoden dieser Klasse daraus zu machen?

Sir Rufo 24. Apr 2015 14:11

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
Zitat:

Zitat von mkinzler (Beitrag 1299093)
Ich würde mich auch erst mal um den Fehler kümmern, den baumina sofort erkannt hat.

Wieso, da ist kein Fehler, oder muss man beim Zugriff auf die Registry neuerdings einen Dateinamen angeben ;)

p80286 24. Apr 2015 14:30

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
Da hier mal wieder eine "Durch die Brust ins Auge"-Lösung aufgebaut wird:
Zitat:

Description

TRegIniFile is a low-level wrapper for the Windows 95/NT system registry.

TRegIniFile presents a simple interface to the system registry, hiding the need to know about the underlying structure of the registry. TRegIniFile acts as a helper object to TRegistryIniFile, which descends from TCustomIniFile (and is therefore more widely compatible with other INI file classes).

TRegIniFile enables handling the Windows 95/NT system registry as if it were a Windows 3.x INI file. Instead of processing an INI file, however, TRegIniFile reads from and writes to the system registry.

Although TRegIniFile descends from TRegistry, it adds the properties and methods used by a TIniFile object. The FileName passed to a TRegIniFile object becomes a subkey under the system registry's root key (HKEY_CURRENT_USER by default). What corresponds to a section in an INI file is treated as a key in the system registry, and what corresponds to data entries under a section in an INI file are treated as data values under a key in the system registry.

Note:TRegIniFile is intended to be used primarily as a helper object to TRegistryIniFile, which unifies the interface to INI files and the system registry. However, applications can use TRegIniFile directly.
Ist der Dateiname doch notwendig.

@Rippo
Schmeiß diese seltsame Zwischenlösung weg, und mach es gleich richtig, entweder Registry oder Parameterdatei (von mir aus auch .INI), und wenn diese, dann bloß nicht im Programmverzeichnis!

Gruß
K-H

Sir Rufo 24. Apr 2015 14:56

AW: Zugriffsverletzung bei Adresse ' ' in Modul
 
@p80286

Aber dieser "Dateiname" benötigt eben nicht einen Dateinamen inkl. komplettem Pfad, so wie baumina das gemeint hat ... ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:40 Uhr.
Seite 2 von 2     12   

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