Registry read/write

Registry read/write

Post by Christia » Wed, 16 Aug 2000 04:00:00



Sorry posted in German before.... the bad side of cut and paste    :-(

Hi there,
I am looking for a method to read and write the Win-Registry.
I tried using WriteProfileString(...) but had no success.

Is there anybody having a fragment of code to show me how to manage that
problem ?

Thanks in advance,
Christian

 
 
 

Registry read/write

Post by Tim Slatter » Wed, 16 Aug 2000 04:00:00



>Sorry posted in German before.... the bad side of cut and paste    :-(

>Hi there,
>I am looking for a method to read and write the Win-Registry.
>I tried using WriteProfileString(...) but had no success.

>Is there anybody having a fragment of code to show me how to manage that
>problem ?

WriteProfileString and the rest of that family write to a *.ini file,
not the registry.

In MFC, call CWinApp::SetRegistryKey(..) before calling
CWinApp::WriteProfileString(). It causes CWinApp:: WriteProfileString
to write to the registry instead of a *.ini file.

In the Win32 API, you'd use the Reg... functions (RegCreate...,
RegDelete..., RegEnum..., RegClose, RegOpen, RegQuery..._

--
Tim Slattery