 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
bashar Guest
|
Posted: Wed May 09, 2007 5:55 pm Post subject: How can I add this value to the Registry? |
|
|
How can I add this value to the Registry?
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
"myMap"=hex:00,00,00,00,5b,e0,00,00,5c
I try this but it won't work
regKey->WriteBinaryData("myMap",(char *)new_binary,sizeof(new_binary));
regKey->CloseKey();
This add a different value |
|
| Back to top |
|
 |
Clayton Arends Guest
|
Posted: Wed May 09, 2007 8:57 pm Post subject: Re: How can I add this value to the Registry? |
|
|
| Quote: | I try this but it won't work
|
Always provide more information besides "it won't work". Mention any
exceptions, compilation errors, etc.
| Quote: | This add a different value
|
What value does it add?
You need to show more of your code. Nobody here knows how 'new_binary' has
been defined.
However, this should work just fine (not tested):
char new_binary[9] = { 0, 0, 0, 0, 0x5b, 0xe0, 0, 0, 0x5c };
TRegistry* reg = new TRegistry(KEY_ALL_ACCESS);
std::auto_ptr<TRegistry> auto_reg(reg); // RAII
reg->RootKey = HKEY_LOCAL_MACHINE;
if (reg->OpenKey("SYSTEM\\CurrentControlSet\\Control", true))
{
reg->WriteBinaryData("myMap", new_binary, sizeof(new_binary));
}
- Clayton |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|