Autor Beitrag
Apo95
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Di 22.07.14 12:47 
Hallo,

ich benötige mal Hilfe beim Zugriff auf die Registry. Ein Lizenzmanager Retgistrierungsdaten in der Registry ablegen; beim Zugriff darauf gibt es die Fehlermeldung: Fehler beim Holen von Daten 22.07.2014

Die Daten werden in 'HKLM\SOFTWARE\EA\MonetalisFV\LM\2014' abgelegt; es existiert der Unterschlüssel 'TL', der das Tagesdatum und den Boolean TRUE enthält.

Woran kann das liegen, dass ich

a) den Schlüssel in der Registry nicht ausfindig machen kann;
b) dieser Fehler erscheint

?

Danke schonmal :nixweiss:

_________________
Lette-Verein MIA
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 22.07.14 13:36 
Bei 64-Bit Betriebssystemen werden 32-Bit Programme auf HKLM\Software\Wow6432Node umgeleitet. Willst du das nicht, musst du das abschalten.

Wenn du nicht explizit mit reinem Lesezugriff auf HKLM zugreifst, brauchst du Adminrechte.
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Di 22.07.14 13:37 

Für diesen Beitrag haben gedankt: Apo95
Apo95 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Mi 23.07.14 12:02 
Danke erstmal sehr für die Antworten ^^

ich brächte nur noch die Informationen, wie ich einen Datumswert und ein Boolean aus der Registry lesen kann.

_________________
Lette-Verein MIA
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 23.07.14 13:14 
user profile iconApo95 hat folgendes geschrieben Zum zitierten Posting springen:
ich brächte nur noch die Informationen, wie ich einen Datumswert und ein Boolean aus der Registry lesen kann.
Einen Datumswert lesen... read date... hmm, dann machen wir das doch auch mit ReadDate...
docwiki.embarcadero....y.TRegistry.ReadDate
Apo95 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Mi 23.07.14 13:26 
Stellt sich nur die Frage: Wie anstellen? wenn ich das eintrage :

ausblenden Delphi-Quelltext
1:
2:
3:
    StringGrid1.Cells[ 4, i ] := reg.ReadDate(
      'ExpDate' ); // Ablaufdatum
    StringGrid1.Cells[ 5, i ] := reg.ReadBool( 'DL',1 ); // Default-Lizenz JA/NEIN


gibt es bei beiden die Fehlermeldung: 'inkompatible typen' aber wie soll ich dem Programm sagen, wie der Schlüssel heißt?! :oops:

_________________
Lette-Verein MIA
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Mi 23.07.14 14:31 
In einem StringGrid stehen Strings, da kann man also keine Datumswerte, Zahlen etc. (direkt) eintragen, sondern diese müssen zuerst in Strings gewandelt werden (DateToStr, IntToStr, FloatToStr etc.).
Apo95 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Do 24.07.14 01:42 
Das hilft mir nicht weiter, leider, :-(

Die Frage ist, was schreib ich jetzt? Der Registry-Schlüssel für das Ablaufdatum ist ExpDate; für den Boolean ist das DL (Default License).

_________________
Lette-Verein MIA
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: Do 24.07.14 08:35 
Deine Fehlermeldung bezieht sich NICHT auf das Auslesen aus der Registry,
sondern auf das Eintragen ins StringGrid.

Es ist einfach nur ein Typecast gemeint:

ausblenden Delphi-Quelltext
1:
2:
  StringGrid1.Cells[ 4, i ] := DateToStr(reg.ReadDate('ExpDate')); // ggf. DateTimeToStr()
  StringGrid1.Cells[ 5, i ] := BoolToStr(reg.ReadBool( 'DL',1 ));


zuma

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Do 24.07.14 09:01 
Genau :D
Apo95 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Win2000, WinXP, WinServer 2003 Standard x86, Win7x64
Delphi 6 Enterprise, D2009 Architect, RAD Studio XE6 Architect
BeitragVerfasst: Do 24.07.14 11:20 
Danke :-)

Ich komm da nie drauf :D

_________________
Lette-Verein MIA