Kfir
Kfir

Reputation: 157

RegOpenCurrentUser handle does not receives any value

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

Answers (1)

dwo
dwo

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

Related Questions