In order to write, you may either use a loop, calling at each iteration
SetWORDValue
or
SetQWORDValue
(as appropriate) or, without the loop, calling just one time
SetBinaryValue
(see
CRegKey Class[
^]).
You may read back the data in a similar way.
You might also have a look at one (or more)
CodeProject article(s) on the Registry topic[
^].