Reputation: 157
HKEY keyCurrentUser;
RegOpenCurrentUser(KEY_READ, &keyCurrentUser);
the debugger always says for keyCurrentUser
CXX0030: Error: expression cannot be evaluated
. I'm using Visual c++ 2010. what am I doing wrong? thanks.
Upvotes: 0
Views: 280
Reputation: 3636
This is what worked for me:
HKEY keyCurrentUser = 0; // !!! the difference
RegOpenCurrentUser(KEY_READ, &keyCurrentUser);
Now the returned key is valid! I can't think of a reason why a function checks a value it overwrites, but it seems there is one.
Upvotes: 2