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?
views:
37answers:
2It's an MFC project.
WhyX1e5
2010-09-16 16:04:05
how would this help?
Steve Townsend
2010-09-16 16:08:05
+1
A:
Use RegOpenKey(Ex) with HKEY_CURRENT_USER
. This is fine so long as your app does not impersonate other users.
Steve Townsend
2010-09-16 16:06:01