control panel applet

Hi everyone,

I'm just wondering if anyone has had problems with Control Panel applets
made in Delphi 5 under Windows 95. The applet works fine under all other
versions of Windows. When it is run under Windows 95, kernel32.dll causes an
illegal operation. It happens as soon as Control Panel is closed down, even
if the applet hasn't been opened.

I have a feeling the problem lies inside of the AppletModuleInquire
procedure. I use this procedure to set the Help string at runtime (see code
below). Does anybody know why this problem is occuring???

Thanks for your help.

Adam

CODE:

//Registry.pas has been declared in the unit's uses clause//

procedure TcpHlpSup.AppletModuleInquire(Sender: TObject; var idIcon,
  idName, idInfo, lData: Integer);
var
    Reg: TRegistry;
begin
    Reg := TRegistry.Create;
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    Reg.OpenKey('SOFTWARE\Help and Support\Details', True);
    if Reg.ValueExists('OEM_Business_Name') then
        Self.Help := 'View policies set by' +
Copy(Reg.ReadString('OEM_Business_Name'), 3,
Length(Reg.ReadString('OEM_Business_Name')))
    else
        Self.Help := 'View generic system policies';
    Reg.CloseKey;
    Reg.Free;
end;