J_E_D_I wrote:
if (ERROR_SUCCESS != RegQueryValueEx(key, "ValueName", NULL, &type, (LPBYTE)&res[0],&size)) { MyChoiceVariable2 = "VALUE DOES NOT EXIST"; cout << MyChoiceVariable2 << endl; } if (ERROR_SUCCESS == RegQueryValueEx(key, "ValueName", NULL, &type, (LPBYTE)&res[0],&size)) { MyChoiceVariable2 = "VALUE EXISTS"; cout << MyChoiceVariable2 << endl; }
have you heard about if...else.. clause in C++.
J_E_D_I wrote:
RegCloseKey(key);
I appreciate your attempt to use the undiscussed RegCloseKey() API which is necessary.