www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - Creating registry keys

reply Colin Caughie <c.caughie indigovisionNOSPAM.com> writes:
Apologies if this has been asked before, but:

I'm new to WinSTL, and have just started using its registry functions. I may
be missing something but I can't find an easy way of creating a new registry
key. I'd like to be able to do something like

winstl::reg_key_w myKey = winstl::create_reg_key(
                             HKEY_CURRENT_USER,
                             L"Software\\MyCompany\\MyApp"
                             );

(i.e. similar to just using the Win32 RegCreateKey), but it seems that instead
I have to do:

winstl::reg_key_w myKey = winstl::reg_key_w( HKEY_CURRENT_USER, L"Software" ).
                             create_sub_key( L"MyCompany\\MyApp" );

which seems needlessly complicated.

Am I missing something?

Thanks in advance,
Colin
May 30 2007
parent "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
 Apologies if this has been asked before, but:

 I'm new to WinSTL, and have just started using its registry functions. I
may
 be missing something but I can't find an easy way of creating a new
registry
 key. I'd like to be able to do something like

 winstl::reg_key_w myKey = winstl::create_reg_key(
                              HKEY_CURRENT_USER,
                              L"Software\\MyCompany\\MyApp"
                              );

 (i.e. similar to just using the Win32 RegCreateKey), but it seems that
instead
 I have to do:

 winstl::reg_key_w myKey = winstl::reg_key_w( HKEY_CURRENT_USER,
L"Software" ).
                              create_sub_key( L"MyCompany\\MyApp" );

 which seems needlessly complicated.

 Am I missing something?

 Thanks in advance,
 Colin
I've answered the question in a blog post on Artima, at http://www.artima.com/weblogs/viewpost.jsp?thread=207128 I've updated the code, which will be included in STLSoft 1.9.2. For the moment, please feel free to use the modified code in the patch http://synesis.com.au/downloads/stlsoft/stlsoft-pre-1.9.2-registry-patch-01.zip. Cheers Matthew
Jun 01 2007