I have been working in the registry for awhile now, not really reading anything though. OF course, when i do i run into trouble. Below is the code i am using, with comments where i get the problems (i think). The registry code is not the problem. It is comparing the return values with predetermined values that i hit the walls.
Even when the data appears to be the same, it still returns false.Code:HKEY hKey; if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Native\\SaveAll"), 0, KEY_QUERY_VALUE, &hKey)) return false; unsigned char buffer[256]; // It puts the data here... unsigned char yes[256] = "Yes"; // What i am going to compare with... unsigned long datatype; unsigned long bufferlength = sizeof(buffer); RegQueryValueEx(hKey, "Active", NULL, &datatype, buffer, &bufferlength); RegCloseKey(hKey); if (buffer == yes) return true; // How do i compare these?? This is where i get the problems. return false;



LinkBack URL
About LinkBacks




