May 30, 2007
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
June 01, 2007
> 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