AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

IdentMap funktioniert nicht

Offene Frage von "blackdrake"
Ein Thema von blackdrake · begonnen am 2. Aug 2009 · letzter Beitrag vom 3. Aug 2009
 
blackdrake

Registriert seit: 21. Aug 2003
Ort: Bammental
618 Beiträge
 
Delphi 10.3 Rio
 
#4

Re: IdentMap funktioniert nicht

  Alt 2. Aug 2009, 21:17
(Nachtrag)

Hier ist die Testkomponente zur schnellen Rekonstruktion.

Delphi-Quellcode:
unit test;

interface

uses
  SysUtils, Classes, Windows;

type
  TRootKey = LongWord;

  TTest = class(TComponent)
  private
    FRootkey: TRootKey;
  public
    constructor Create(AOwner: TComponent); override;
  published
    property RootKey: TRootKey read FRootKey write FRootKey default HKEY_CURRENT_USER;
  end;

const
  RootKeys: array[0..6] of TIdentMapEntry = (
    (Value: HKEY_CLASSES_ROOT - $80000000; Name: 'HLEY_CLASSES_ROOT'),
    (Value: HKEY_CURRENT_USER - $80000000; Name: 'HKEY_CURRENT_USER'),
    (Value: HKEY_LOCAL_MACHINE - $80000000; Name: 'HKEY_LOCAL_MACHINE'),
    (Value: HKEY_USERS - $80000000; Name: 'HKEY_USERS'),
    (Value: HKEY_PERFORMANCE_DATA - $80000000; Name: 'HKEY_PERFORMANCE_DATA'),
    (Value: HKEY_CURRENT_CONFIG - $80000000; Name: 'HKEY_CURRENT_CONFIG'),
    (Value: HKEY_DYN_DATA - $80000000; Name: 'HKEY_DYN_DATA')
  );

function IdentToRootKey(const Ident: string; var RootKey: Longint): Boolean;
function RootKeyToIdent(RootKey: Longint; var Ident: string): Boolean;

procedure Register;

implementation

constructor TTest.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);

  RootKey := HKEY_CURRENT_USER;
end;

procedure Register;
begin
  RegisterComponents('Beispiele', [TTest]);
end;

function RootKeyToIdent(RootKey: Longint; var Ident: string): Boolean;
begin
  Result := IntToIdent(RootKey, Ident, RootKeys);
end;

function IdentToRootKey(const Ident: string; var RootKey: Longint): Boolean;
begin
  Result := IdentToInt(Ident, RootKey, RootKeys);
end;

initialization
  RegisterIntegerConsts(TypeInfo(TRootKey), IdentToRootKey, RootKeyToIdent);
end.
Im OI steht dann 2147483649, aber keine DropDown-Box. Ident-Werte wie "HKEY_CURRENT_USER" werden als ungültig gekenneichnet. Weiß jemand, woran es liegt?
Daniel Marschall
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:29 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz