I have following code in MFC dialog:
DWORD dwDisp = 0;
LPDWORD lpdwDisp = &dwDisp;
CString regKey = "Sofware\\Testing";
int ret = RegCreateKeyEx(HKEY_LOCAL_MACHINE, regKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, ®, lpdwDisp);
RegSetValueEx(reg, "TestMethod", 0, 1, (PBYTE)&method, sizeof(method));
I want to get it working in XP and Vista... What's wrong in above code? I always get 87 (INVALID_PARAMETER) in ret variable.