views:

37

answers:

2

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?

A: 

wouldn't it be simpler to get Microsoft Visual Studio Express?

iddqd
It's an MFC project.
WhyX1e5
how would this help?
Steve Townsend
+1  A: 

Use RegOpenKey(Ex) with HKEY_CURRENT_USER. This is fine so long as your app does not impersonate other users.

Steve Townsend