Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write/read the Registry 1

Status
Not open for further replies.

801119

Programmer
Apr 10, 2000
311
SE
<br>Is there any simple way to write or read information from the registry?<br>or just the hard way?? <p>Martin G Broman<br><a href=mailto:mgb_svea@hotmail.com>mgb_svea@hotmail.com</a><br><a href= > </a><br>DWS - Alpha Whitin Dead Wolf Society
 
You can use the TRegistry class. <p>Ferran Casarramona<br><a href=mailto: > </a><br><a href= > </a><br>
 
Thanks!<br>There is still this problem, i do not know how to use it!<br>tried to read the help files, did no good!<br>So if you could write a quick code to write a registry entry<br>and another to read that same entry!<br>Thanks again for any further help! <p>Martin G Broman<br><a href=mailto:mgb_svea@hotmail.com>mgb_svea@hotmail.com</a><br><a href= > </a><br>DWS - Alpha Whitin Dead Wolf Society
 
TRegistry *Path;<br><br>Path=new TRegistry;<br>Path-&gt;RootKey=HKEY_LOCAL_MACHINE; // Or other Root key<br>Path-&gt;OpenKey(&quot;\\Software\\MySoftware&quot;,true);&nbsp;&nbsp;// Open or create<br><br>// To assure you have a value :<br>if (!Path-&gt;ValueExists(&quot;MyKey&quot;)){<br>&nbsp;&nbsp;&nbsp;&nbsp;Path-&gt;WriteInteger(&quot;MyKey&quot;,_DEFAUL_VALUEl);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>// To Read :<br>int Value;<br>Value=Path-&gt;ReadInteger(&quot;MyKey&quot;);<br>&nbsp;// or <br>String Value;<br>Value=Path-&gt;ReadString(&quot;MyKey&quot;);<br><br>// Write :<br>int Value;<br>Path-&gt;WriteInteger(&quot;MyKey&quot;,Value);<br>&nbsp;// or <br>String Value;<br>Path-&gt;WriteInteger(&quot;MyKey&quot;,Value);<br>...<br>delete Path;<br>&nbsp;&nbsp; <p>Ferran Casarramona<br><a href=mailto: > </a><br><a href= > </a><br>
 
you know if you just put some extra explanations into it, that response could make a good FAQ for this forum. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top