BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I add this value to the Registry?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
bashar
Guest





PostPosted: Wed May 09, 2007 5:55 pm    Post subject: How can I add this value to the Registry? Reply with quote



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





PostPosted: Wed May 09, 2007 8:57 pm    Post subject: Re: How can I add this value to the Registry? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.