🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by bashar Wed, 09 May 2007 12:55
How can I add this value to the Registry?
#2009
Author: bashar
Date: Wed, 09 May 2007 12:55
10 lines
1226 bytes
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 
Re: How can I add this value to the Registry?
#2010
Author: Clayton Arends
Date: Wed, 09 May 2007 15:57
25 lines
1666 bytes
> I try this but it won't work

Always provide more information besides "it won't work".  Mention any 
exceptions, compilation errors, etc.

> 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 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads