Writing to the registry in Windows 95
Posted on 2001-07-04
I have written an application that uses the windows registry to store an integer value, and when required, read and modify that integer value.
The Following code shows this, Note that "<Registry Path>" represents the path to the applications Registry Key.
Reg := TRegistry.Create;
with Reg do
Rootkey := HKEY_LOCAL_MACHINE;
if not ValueExists('IntegerValue') then
BookingStatsReportCount := 0;
BookingStatsReportCount := ReadInteger('98');
This code works fine for Windows 98, Me, and NT4, but when the application is installed and run in windows 95 I get a runtime error like:
"Error: Failed to set data 'IntegerValue' Data was not written"
Is there something with the registry in Windows 95 that is different to later versions?
If so, How can I get around this problem other than recommending that the application not be run under windows 95?