I've done that with the following code:
// string sKey = "ColorTable02"
// string sData = "00008000"
dwType = REG_DWORD;
dwSize = sizeof(DWORD);
int i = atoi(sData.c_str());
RegSetValueEx(hKey,sKey.c_str(),0,dwType,(PBYTE)&i,dwSize);
It work's fine BUT when sData contains letters such as "00f08a00". It
won't work.
offcourse it's because of the atoi function BUT I have no idea which
other function can do the work.
Thanks
Dave.
|It work's fine BUT when sData contains letters such as "00f08a00". It
|won't work.
|offcourse it's because of the atoi function BUT I have no idea which
|other function can do the work.
strtoul()
You can specify hex (base = 16).
--
- Vince