I don't know what's wrong with function TRegistry:GetKeyNames()
Hi,
Thanks for your giving directions.
Now my code looks like this,but it can't pass the compiler ,the
error message identify that there is same problem:
[C++ Error] getparameter.cpp(41): E2109 Not an allowed type.
the line 41 is : if(!Reg->GetKeyNames(ListBox1->Items))
I can't understand the real meaning of the error message.
can you help me?
thank you very much.
LiuXiao
void __fastcall TOKRightDlg1::FormCreate(TObject *Sender)
{
TRegistry *Reg = NULL;
try
{
Reg = new TRegistry;
Reg->RootKey = HKEY_LOCAL_MACHINE;
if(!Reg->OpenKey("\\SOFTWARE",false))
ShowMessage("Error in Opening Key SOFTWARE");
else
{
ListBox1->Columns=1;
if(!Reg->GetKeyNames(ListBox1->Items)) //Have Error.
ShowMessage("Fuction GetKeyNames Occurs Error!");
else
{
ListBox1->Items->Add("test1");
ListBox1->Items->Add("test2");
ListBox1->Items->Add("test3");
ListBox1->Repaint();
}
}
}
__finally
{
delete Reg;
}