Okay, so I've been looking at this for quite some time. I think I know what the problem is, but my C++ skills are sad a best due to stuff like Java, C# and VB. So, I'm trying to pull information from the registry, and I have no problem getting it to work. I can pull REG_SZ values just fine. I can output them and everything. Now, I'm trying to get REG_DWORDs to work, but am having issues. When I have it look at something that has a DWORD value of like 546258943, the program spits out something like " ?Å ╪·"☺t·"" Unfortunately, this is not my intended output. So, the way I see it, I've got this char buffer that I'm filling with this numerical data, which it's interpreting as a character array what it outputs it. So, my dilemma is to get it not to do that.
#include <windows.h>
#include <iostream>
using namespace std;
int main () {
HKEY keyHandle;
char rgValue [1024];
LPCTSTR regPath = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0";
LPCTSTR regReq = "FeatureSet";
DWORD size1 = sizeof(rgValue);
DWORD Type;
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, regPath,0, KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS) {
RegQueryValueEx( keyHandle, regReq, NULL, &Type, (LPBYTE)rgValue,&size1);
}
RegCloseKey(keyHandle);
std::cout << "Returned: -->" << rgValue << "<-- (at least I think so) \n\n";
system("Pause");
}