I have ported some code from a C++ builder 5 application. the code simply reads a registry key but does not work with embarcadero XE2.
The issue is not due to permissions because the same registry key can be read by the application compiled with BCB 5 on the same PC where the XE2 compiler is used.
The only difference being UnicodeStrings.
I am using Windows 7 Pro 64 bit. I attach a screen shot of the registry key in question.
When the program is run, the LastErrorMsg which I display in a Memo control is "The system cannot find the file specified"
The code is as follows:
void __fastcall TForm1::Button1Click(TObje
key = L"SOFTWARE\\Alcindor\\CRVM
v = L"defaultdbs";
reg = new TRegistry();
reg->RootKey = HKEY_LOCAL_MACHINE;
ok = reg->OpenKey(key,false);
u = reg->ReadString(v);
Label1->Caption = u;