hey, i'm trying to check if a registry key exists and i open the key with this code:and then i need to query it (i believe) because i need to check if a key exists which the program creates depending on the user, and then if the key is there i need the value stored. so i've tried:Code:/* variables */ TCHAR szBuf[20] = "Software\\ShibbyInc", value[9] = "Password"; LPDWORD type; LONG regresult; HKEY hkey; if (RegOpenKeyEx(HKEY_CURRENT_USER, szBuf, 0, KEY_READ, &hkey)) { return FALSE; }but with either query, i get the Windows message saying i violated memoryCode:regresult = RegQueryValueEx(hkey, value, NULL, type, NULL, NULL); if (regresult == ERROR_SUCCESS) MessageBox(hwnd, "it exists.", "ok", MB_OK); and if (RegQueryValueEx(hkey, value, NULL, type, NULL, NULL)) MessageBox(hwnd, "it exists.", "ok", MB_OK);what am i doing wrong?
thanks



LinkBack URL
About LinkBacks
what am i doing wrong?



thank you.