Board index » cppbuilder » TRegistry->WriteBool() throws exception
TRegistry->WriteBool() throws exception
2005-07-22 01:27:34 PM
I know this might be trivial, but I couldn't locate any post on this with
search, so I'll have to ask it.
I'm using TRegistry to access the Registry, when I tried to use
WriteBool(ValName, Value), BCB always give me an exception upon compiling:
Project TCPrinter.exe raised an exception class ERegistryException with
message 'Failed to set data for 'AutoMode''. Process stopped.
The problem sourced from this block of code:
void __fastcall TForm1::AutoCheckClick(TObject *Sender)
TRegistry *reg = new TRegistry;
AutoCheck is a TCheckBox, AutoMode is the Registry Value Name.
The strange thing is, it's thrown upon compiling, I haven't triggered the
event yet. I do have a reg->ReadBool() in the constructor, but it never
caused any problem. I deleted the reg at the end of the constructor, so it's
not object conflict problem...
Anyone have any idea what's wrong? Thanks in advance.