TheDarkSide
Jun 25th, 2002, 09:43 PM
I am trying to write to the registry. I can create a key, but not a value. can someone tell me what is wrong with this code?
HKEY hkey;
DWORD dmDisposition;
RegCreateKeyEx( HKEY_LOCAL_MACHINE, TEXT("Software\\My Company\\My App"), 0, 0, 0, 0, 0, &hkey, &dmDisposition );
DWORD dwType, cbData;
BYTE m_dwMaxFileSize;
dwType = REG_SZ;
cbData = sizeof(REG_SZ);
RegSetValueEx( hkey, TEXT("MaxFileSize"), 0, dwType, (PBYTE)"hi", cbData );
RegCloseKey(hkey);
HKEY hkey;
DWORD dmDisposition;
RegCreateKeyEx( HKEY_LOCAL_MACHINE, TEXT("Software\\My Company\\My App"), 0, 0, 0, 0, 0, &hkey, &dmDisposition );
DWORD dwType, cbData;
BYTE m_dwMaxFileSize;
dwType = REG_SZ;
cbData = sizeof(REG_SZ);
RegSetValueEx( hkey, TEXT("MaxFileSize"), 0, dwType, (PBYTE)"hi", cbData );
RegCloseKey(hkey);