c++ - QueryDWORDValue returns 0 -
i using cregkey retreive dword value registry. code below returns 0 (buf zero), actual value in registry 1354357483.
cregkey reg; reg.open(hkey_local_machine, "software\\microsoft\\windows nt\\currentversion", key_read); dword buf; dword s = reg.querydwordvalue("installdate", buf); if (s == error_success) { reg.querydwordvalue("installdate", buf); cout << hex << buf; }
i suspect has character sets far not find solution. project character settings set "not set". tried unicode , using wide strings no avail.
also followup question, there way read binary data registry , casting std::string? data addition/loss not problem trying do.
hans passant correct. program reading 32bit version of registry while regedit showing 64bit version why values did not match. adding key_wow64_64key flag read intended registry solved problem.
Comments
Post a Comment