View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0022611FPCPackagespublic2012-08-09 14:262012-08-09 14:26
ReporterManfred Hahn 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusnewResolutionopen 
PlatformWindowsOSWindows 7OS Version64-bit
Product Version2.6.0Product Build 
Target VersionFixed in Version 
Summary0022611: TRegistryIniFile does not work as expected
DescriptionTRegistryIniFile does not read/write the expected keys and values in the windows registry.
Steps To Reproduceon a windows system execute something like this:
  var RegistryIniFile : TRegistryIniFile;
  ...
  RegistryIniFile.Create('Testsection\Subsection');
  RegistryIniFile.WriteString('StringKey','StringLabel','TestString');
  ...

Look into the registry (regedit) for the key. It has to be
  HKEY_CURRENT_USER\Testsection\Subsection\StringKey\StringLabel
with a value 'TestString'.
You will not find it. Neither you will be able to read a string at a known position in the registry.
Additional InformationThis is because the FileName given in the TRegistryIniFile.Create constructor is not taken into account in the functions ReadString etc. The actually used registry key always has to be build by concatenation of the FileName and the Section param of the individual functions/procedures.

To overcome this error I have changed the TRegistryIniFile implementation.
I defer all functionality to the TRegIniFile class. TRegIniFile has been extended for reading/writing Float/Time/Date/Datetime-Values.
I have decided not to deal with the CurrentKey, which was preserved in the old code. TRegistryIniFile had been made to be a substitute for TIniFile, where a CurrentKey is not known. If there is a need for preserving CurrentKey it should be done completely in TRegIniFile. But I don't believe this to be necessary.

In the appendix is a diff file with my changes. (diff from trunc)
TagsNo tags attached.
FPCOldBugId
Fixed in Revision
Attached Filesdiff file icon patch.diff [^] (16,158 bytes) 2012-08-09 14:26 [Show Content]

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2012-08-09 14:26 Manfred Hahn New Issue
2012-08-09 14:26 Manfred Hahn File Added: patch.diff



MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker