I don't know much C/C++, but you can just create a temporary file with a .reg extension, write your registry commands to it, and call system(strcat("regedit /s ", "Name of .reg")); to register it. Windows registry files for 9x should look like this:
REGEDIT4
[name of key] "name of value"=type:value
and Windows 2000/XP registry files should look like this:
Windows Registry Editor Version 5.00
[name of key] "name of value"=type:value