I'm working on a Visual C++ 8 project on WinXP but
unfortunately I have only Visual C++ 6.0 available.
When compiling it,an error is raised:
"error C2065: 'RegOpenCurrentUser' : undeclared identifier".
Since RegOpenCurrentUser
has been introduced as late as Windows 2000,it's not included in VC6 header files.I try to declare it myself and add #pragma comment(lib, "C:\\Microsoft SDKs\\Windows\\v6.0A\\Lib\\Advapi32.lib")
to the source code,but it doesn't work.
How can I call it or is there any equivalent function?
0
votes
wouldn't it be simpler to get Microsoft Visual Studio Express?
– iddqd
1 Answers
2
votes
Use RegOpenKey(Ex) with HKEY_CURRENT_USER
. This is fine so long as your app does not impersonate other users.