<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Registry] Unicode-Strings vernünftig speichern]]></title><description><![CDATA[<p>Hallo Community.</p>
<p>Ich bin auf der Suche nach einer Lösung, mit der ich Unicode-Strings (WCHARs} laden und speichern kann. Dazu wollte ich die Funktionen RegQueryValueEx und RegSetValueEx verwenden. Das Problem ist die Konvertierung der Variablen.</p>
<p>Was nun?</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/214000/registry-unicode-strings-vernünftig-speichern</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 08:06:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/214000.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 May 2008 14:13:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Registry] Unicode-Strings vernünftig speichern on Sat, 24 May 2008 14:13:59 GMT]]></title><description><![CDATA[<p>Hallo Community.</p>
<p>Ich bin auf der Suche nach einer Lösung, mit der ich Unicode-Strings (WCHARs} laden und speichern kann. Dazu wollte ich die Funktionen RegQueryValueEx und RegSetValueEx verwenden. Das Problem ist die Konvertierung der Variablen.</p>
<p>Was nun?</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1515787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1515787</guid><dc:creator><![CDATA[ViperBytes]]></dc:creator><pubDate>Sat, 24 May 2008 14:13:59 GMT</pubDate></item><item><title><![CDATA[Reply to [Registry] Unicode-Strings vernünftig speichern on Sun, 25 May 2008 08:21:06 GMT]]></title><description><![CDATA[<p>hat denn keiner ne idee?</p>
<p>Gegeben ist ein geöffneter Schlüssel und ein WCHAR[MAX_PATH]. Wie bekomme ich das WCHAR in die Registry???</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1516147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1516147</guid><dc:creator><![CDATA[Viperbytes@off]]></dc:creator><pubDate>Sun, 25 May 2008 08:21:06 GMT</pubDate></item><item><title><![CDATA[Reply to [Registry] Unicode-Strings vernünftig speichern on Sun, 25 May 2008 08:25:12 GMT]]></title><description><![CDATA[<p>Verwende &quot;RegQueryValueExW&quot; und &quot;RegSetValueExW&quot;, dann sollte es sehr einfach gehen... (siehe MSDN-DOku; sogar mit Beispiel).</p>
<p>Und was meinst DU mit &quot;Konvertierung&quot;???? Was willst Du wohin konvertieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1516149</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1516149</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 25 May 2008 08:25:12 GMT</pubDate></item><item><title><![CDATA[Reply to [Registry] Unicode-Strings vernünftig speichern on Sun, 25 May 2008 08:36:29 GMT]]></title><description><![CDATA[<p>Ich meine, ich habe doch ein LPBYTE als lpData.</p>
<p>Aber wie bekomme ich mein LPWSTR darein und wie bestimme ich die Größe in Byte?</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1516153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1516153</guid><dc:creator><![CDATA[ViperBytes@off]]></dc:creator><pubDate>Sun, 25 May 2008 08:36:29 GMT</pubDate></item><item><title><![CDATA[Reply to [Registry] Unicode-Strings vernünftig speichern on Sun, 25 May 2008 08:49:11 GMT]]></title><description><![CDATA[<p>oh man</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1516156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1516156</guid><dc:creator><![CDATA[junge junge]]></dc:creator><pubDate>Sun, 25 May 2008 08:49:11 GMT</pubDate></item><item><title><![CDATA[Reply to [Registry] Unicode-Strings vernünftig speichern on Sun, 25 May 2008 09:51:42 GMT]]></title><description><![CDATA[<p>So, ich kann jetzt lesen:</p>
<pre><code class="language-cpp">BYTE bBuffer[MAX_PATH * sizeof(WCHAR)];
	DWORD cbBuffer, dwType;

	HKEY hKey;
	RegCreateKeyEx(HKEY_CURRENT_USER, TEXT(&quot;Software\\ShareManager&quot;), 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &amp;hKey, 0);

	cbBuffer = sizeof(bBuffer);
	if ((RegQueryValueEx(hKey, TEXT(&quot;IncomingDirectory&quot;), 0, &amp;dwType, bBuffer, &amp;cbBuffer) == ERROR_SUCCESS) &amp;&amp; (dwType == REG_SZ))
		memcpy(szIncomingDirectory, bBuffer, sizeof(szIncomingDirectory));
	else
		szIncomingDirectory[0] = L'\0';
// ...
</code></pre>
<p>Aber beim Schreiben in die Registry bekomme ich noch Probleme:</p>
<pre><code class="language-cpp">cbBuffer = sizeof(bBuffer);
	memcpy(bBuffer, szIncomingDirectory, sizeof(bBuffer));
	RegSetValueEx(hKey, TEXT(&quot;Test&quot;), 0, REG_SZ, bBuffer, cbBuffer);
</code></pre>
<p>Wenn ich regedit öffne, stehen da so komige '...' als Wert. Wenn ich diesen dann bearbeiten will, ist das Feld leer.</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1516185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1516185</guid><dc:creator><![CDATA[ViperBytes]]></dc:creator><pubDate>Sun, 25 May 2008 09:51:42 GMT</pubDate></item></channel></rss>