🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1859

problems of saving a registry key to a file

#1859
From: han
Date: Mon, 28 May 2007 05:07
12 lines
1342 bytes
I am trying to save a key to a file using SaveKey, but I always fail. The open key is successfull, but saveKey is not successful, The file is generated, but the size of the file is zero. The following is my code.
TRegistry myRegistry = new TRegistry;
AnsiString Key = "Software\\XXXCompany\\Settings\\ViewForms"
  if ( myRegistry->OpenKey (key, false) != true )
     Application->MessageBox("open key error", NULL, MB_OK);
 AnsiString fileName("tempReg");

  if (  myRegistry->SaveKey(key, fileName) != true)
    Application->MessageBox("save key error", NULL, MB_OK);;

Any suggestions? Thanks a lot.
Technical Details
Message-ID: <465a6397@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,321743db05a8d51,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "han" <hanzhangusa@yahoo.com>
Sender: "han" <hanzhangusa@yahoo.com>
Reply-To: "han" <hanzhangusa@yahoo.com>
Subject: problems of saving a registry key to a file
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 64.143.221.52     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <465a6397@newsgroups.borland.com>
Date: 27 May 2007 22:07:35 -0700
X-Trace: newsgroups.borland.com 1180328855 207.105.83.66 (27 May 2007 22:07:35 -0700)
Lines: 12
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail