<?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[RegSetValueEx(); Fehler]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte mit dem folgenden Codeschnipsel in der Registry einen Schlüssel und den dazugehörigen Key erstellen. Leider gibt mein Compiler (Dev-C++) eine Fehlermeldung aus:</p>
<pre><code>C:\Dokumente und Einstellungen\Admin\Desktop\projekt\main.cpp In function `int main(int, char**)': 
 C:\Dokumente und Einstellungen\Admin\Desktop\projekt\main.cpp In function `int main(int, char**)': 
 C:\Dokumente und Einstellungen\Admin\Desktop\projekt\Makefile.win [Build Error]  [main.o] Error 1
</code></pre>
<p>Wenn ich das richtig sehe, wird der Fehler durch eine falsch deklarierte Variable hervorgerufen. Ich habe es schon mit anderen Datentypen versucht, aber ohne Erfolg. Hier also der Code:</p>
<pre><code>#include &lt;conio.h&gt;
#include &lt;windows.h&gt;
#include &lt;winreg.h&gt;

using namespace std;

int main(int argc, char *argv[]) {

// schlüssel hinzufügen
HKEY hKey;
RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Test&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);

// key erstellen
BYTE cString[]=&quot;&quot;;
RegSetValueEx(hKey,&quot;KeyName&quot;,0,REG_SZ,cString,strlen(cString)+1);

return 0;

}
</code></pre>
<p>Danke für alle Antworten!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/176769/regsetvalueex-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 17:34:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/176769.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Mar 2007 18:27:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sat, 24 Mar 2007 18:27:50 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte mit dem folgenden Codeschnipsel in der Registry einen Schlüssel und den dazugehörigen Key erstellen. Leider gibt mein Compiler (Dev-C++) eine Fehlermeldung aus:</p>
<pre><code>C:\Dokumente und Einstellungen\Admin\Desktop\projekt\main.cpp In function `int main(int, char**)': 
 C:\Dokumente und Einstellungen\Admin\Desktop\projekt\main.cpp In function `int main(int, char**)': 
 C:\Dokumente und Einstellungen\Admin\Desktop\projekt\Makefile.win [Build Error]  [main.o] Error 1
</code></pre>
<p>Wenn ich das richtig sehe, wird der Fehler durch eine falsch deklarierte Variable hervorgerufen. Ich habe es schon mit anderen Datentypen versucht, aber ohne Erfolg. Hier also der Code:</p>
<pre><code>#include &lt;conio.h&gt;
#include &lt;windows.h&gt;
#include &lt;winreg.h&gt;

using namespace std;

int main(int argc, char *argv[]) {

// schlüssel hinzufügen
HKEY hKey;
RegCreateKeyEx(HKEY_CURRENT_USER,&quot;Test&quot;,0,0,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&amp;hKey,0);

// key erstellen
BYTE cString[]=&quot;&quot;;
RegSetValueEx(hKey,&quot;KeyName&quot;,0,REG_SZ,cString,strlen(cString)+1);

return 0;

}
</code></pre>
<p>Danke für alle Antworten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1251800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1251800</guid><dc:creator><![CDATA[Gast2007]]></dc:creator><pubDate>Sat, 24 Mar 2007 18:27:50 GMT</pubDate></item><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sat, 24 Mar 2007 19:11:51 GMT]]></title><description><![CDATA[<p>steht nach dem : nicht der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1251827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1251827</guid><dc:creator><![CDATA[ähhhh]]></dc:creator><pubDate>Sat, 24 Mar 2007 19:11:51 GMT</pubDate></item><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sat, 24 Mar 2007 19:24:31 GMT]]></title><description><![CDATA[<p>Sorry, hatte doppelt eingefügt. Das steht in der Mitte:</p>
<pre><code>16 C:\Dokumente und Einstellungen\Julius\Desktop\speedup_reg\main.cpp syntax error before `char'
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1251831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1251831</guid><dc:creator><![CDATA[Gast2007]]></dc:creator><pubDate>Sat, 24 Mar 2007 19:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sun, 25 Mar 2007 07:20:54 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1252034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1252034</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 25 Mar 2007 07:20:54 GMT</pubDate></item><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sun, 25 Mar 2007 09:58:11 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;

int main() 
{
	HKEY	hKey;
	DWORD	dwDispo;
	RegCreateKeyEx(HKEY_CURRENT_USER, TEXT(&quot;Key&quot;), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &amp;hKey, &amp;dwDispo);
	TCHAR	szData[128];
	_sntprintf(szData, 128, TEXT(&quot;Value&quot;));
	RegSetValueEx(hKey, &quot;KeyName&quot;, 0, REG_SZ, (LPBYTE)(&amp;szData), strlen(szData) + 1);
	RegCloseKey(hKey);
}
</code></pre>
<p>sollte eigentlich funktionieren ...</p>
<p><strong>edit</strong><br />
text-makro eingesetzt und Schlüsselnamen verändert und nen Kommentar von dir entfernt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1252052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1252052</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 25 Mar 2007 09:58:11 GMT</pubDate></item><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sun, 25 Mar 2007 09:46:09 GMT]]></title><description><![CDATA[<p>OT: 15 Jahre nach einführung von Unicode in die Windows-Welt sollten auch die letzten Programmierer endlich anfangen konsequent mit TCHAR zu arbeiten...</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;tchar.h&gt;

int _tmain() 
{
    // schlüssel hinzufügen
    HKEY    hKey;
    DWORD    dwDispo;
    RegCreateKeyEx(HKEY_CURRENT_USER, _T(&quot;RemDlgPos&quot;), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &amp;hKey, &amp;dwDispo);
    TCHAR    szData[128];
    _sntprintf(szData, 128, _T(&quot;Value&quot;));
    RegSetValueEx(hKey, _T(&quot;KeyName&quot;), 0, REG_SZ, (LPBYTE)szData, (DWORD) ((_tcslen(szData) + 1) * sizeof(TCHAR))); 
    RegCloseKey(hKey);
}
</code></pre>
<p>PS: Hab das <a href="http://msdn2.microsoft.com/en-us/library/aa363634.aspx" rel="nofollow">Beispiel auf MSDN</a> auch gleich korrigiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1252058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1252058</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 25 Mar 2007 09:46:09 GMT</pubDate></item><item><title><![CDATA[Reply to RegSetValueEx(); Fehler on Sun, 25 Mar 2007 11:11:03 GMT]]></title><description><![CDATA[<p>Vielen Dank euch beiden, funktioniert einwandfrei!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1252126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1252126</guid><dc:creator><![CDATA[Gast2007]]></dc:creator><pubDate>Sun, 25 Mar 2007 11:11:03 GMT</pubDate></item></channel></rss>