<?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[Dateien auf Desktop Kopieren]]></title><description><![CDATA[<p>Hiho!</p>
<p>Ich habe ein problem: Ich möchte mit einer ofstream-instanz ein neues txt-dokument erstellen. Nun möchte ich aber sichergehen, dass es auch auf dem Desktop landet und nicht im ordner der Datei. Wie kann ich das erreichen? ALso, geht es auch, ohne dass der Benutzer den Pfad angibt? Weil die Location vom Dektop ist ja je nach benutzername unterschiedlich, gibt es da eine allgemeine Form?</p>
<p>MFG<br />
Lorizean</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/136469/dateien-auf-desktop-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 18:15:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/136469.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Feb 2006 13:17:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:17:51 GMT]]></title><description><![CDATA[<p>Hiho!</p>
<p>Ich habe ein problem: Ich möchte mit einer ofstream-instanz ein neues txt-dokument erstellen. Nun möchte ich aber sichergehen, dass es auch auf dem Desktop landet und nicht im ordner der Datei. Wie kann ich das erreichen? ALso, geht es auch, ohne dass der Benutzer den Pfad angibt? Weil die Location vom Dektop ist ja je nach benutzername unterschiedlich, gibt es da eine allgemeine Form?</p>
<p>MFG<br />
Lorizean</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990894</guid><dc:creator><![CDATA[Lorizean]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:17:51 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:22:00 GMT]]></title><description><![CDATA[<p>Die Adresse des Desktop mußt du aus der Registry raussuchen (per RegQueryValueEx()) - die genaue Position dort kann ich dir leider nicht aus dem Kopf sagen, auf jeden Fall irgendwo unterhalb von HKEY_CURRENT_USER.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990900</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:22:00 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:25:34 GMT]]></title><description><![CDATA[<p>SHGetSpecialFolderLocation mit CSIDL_DESKTOPDIRECTORY.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990908</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:25:34 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:35:33 GMT]]></title><description><![CDATA[<p>vielen dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990920</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990920</guid><dc:creator><![CDATA[Lorizean]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:41:27 GMT]]></title><description><![CDATA[<p>könnt ihr mal einen Beispiel Quellcode schreiben?<br />
Sind das oben Regestry Einträge oder Funktionen oder wie?</p>
<p>bin gerade am verzweifeln und kreeg das einfach nich raus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/990923</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990923</guid><dc:creator><![CDATA[g3bk47]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:41:27 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:56:56 GMT]]></title><description><![CDATA[<p>SHGetSpecialFolderLocation() ist eine Funktion, CSIDL_... ist eine Konsante, die du der Funktion als Parameter übergeben kannst.</p>
<p>Um mal etwas Code zu bringen:</p>
<pre><code class="language-cpp">TCHAR path[MAX_PATH];
SHGetSpecialFolderPath(0,path,CSIDL_DESKTOPDIRECTORY,false);
//-&gt; in path steht jetzt der Pfad des Desktops
</code></pre>
<p>(PS: ich weiß, das ist nicht die oben genannte Funktion, aber um nur den Pfad zu bekommen, will ich keine umständliche ItemID-Liste abklappern :D)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990935</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:56:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 13:59:11 GMT]]></title><description><![CDATA[<p>SHGetFolderPath ist noch einfacher:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;shlobj.h&gt;

int main()
{
	char path[MAX_PATH];
	if(SUCCEEDED(SHGetFolderPath(0, CSIDL_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, path)))
	{
		MessageBox(0, path, &quot;Hier ist der Desktop&quot;, MB_OK);
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/990940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990940</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Fri, 10 Feb 2006 13:59:11 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:13:44 GMT]]></title><description><![CDATA[<p>MFK schrieb:</p>
<blockquote>
<p>SHGetFolderPath ist noch einfacher:</p>
</blockquote>
<p>Kurze Querfrage: Warum?</p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990949</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:13:44 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:18:36 GMT]]></title><description><![CDATA[<p>SideWinder schrieb:</p>
<blockquote>
<p>Kurze Querfrage: Warum?</p>
</blockquote>
<p>Ich meinte einfacher als SHGetSpecialFolderLocation, weil man sich nicht mit mit einer IDL herumschlagen muss. Das hat sich mit CStolls letztem Beitrag überschnitten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990952</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:21:36 GMT]]></title><description><![CDATA[<p>hm.. brauch man irgendwelche headerdateien?<br />
ich habe hier einen kleinen quellcode-ausschnitt:</p>
<pre><code>ofstream schreiben;
	string endung;
	string datei;
	endung = &quot;.txt&quot;;
	int loop = 0;
        TCHAR path[MAX_PATH]; 
	SHGetSpecialFolderPath(0,path,CSIDL_DESKTOPDIRECTORY,false);

	while(loop != 5)
	{
		++loop;
		char str[3];
		sprintf(str, &quot;%d&quot;, loop);
		datei =  path + str + endung;
		schreiben.open(datei.c_str(), ios_base::out);
		for(long loop2 = 0; loop2 &lt;= 2; ++loop2)
		{
			schreiben &lt;&lt; loop2 &lt;&lt; endl;
		}
		schreiben.close();
</code></pre>
<p>also ich möchte 5 txt-dokumente auf den dektop tun, in denen jeweils 0-2 drinsteht. wie schaffe ich es nun, dass &quot;datei&quot; den Pfad + 1-5 + &quot;.txt&quot; speichert und das ganze dann dahin kopiert wird?<br />
ich bekomme mehrere fehlermeldungen, unter anderem, dass 2 zeiger nicht addiert werden können und dass SHGetSpecialFolderPath und CSIDL_DESKTOPDIRECTORY nicht-deklarierte bezeichner seien... was mache ich falsch?<br />
mfg<br />
Lorizean</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990958</guid><dc:creator><![CDATA[Lorizean]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:21:36 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:23:35 GMT]]></title><description><![CDATA[<p>hm, hab jetzt die nötigen ehader-dateien eingebunden, aber mein problem mit dem datei-namen bleibt..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990961</guid><dc:creator><![CDATA[Lorizean]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:23:35 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:28:00 GMT]]></title><description><![CDATA[<p>Lorizean schrieb:</p>
<blockquote>
<p>ich bekomme mehrere fehlermeldungen, unter anderem, dass 2 zeiger nicht addiert werden können</p>
</blockquote>
<p>Der String::operator+ greift leider nicht, wenn du nur char* verwendest, also mußt du einen der Operanden in std::string umwandeln:</p>
<pre><code class="language-cpp">datei =  string(path) + str + endung;
</code></pre>
<blockquote>
<p>und dass SHGetSpecialFolderPath und CSIDL_DESKTOPDIRECTORY nicht-deklarierte bezeichner seien</p>
</blockquote>
<p>in der Dokumentation nach dem richtigen Header suchen und den einbinden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990964</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:30:10 GMT]]></title><description><![CDATA[<p>vielen dank leute^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990965</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990965</guid><dc:creator><![CDATA[Lorizean]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:30:10 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Fri, 10 Feb 2006 14:39:52 GMT]]></title><description><![CDATA[<p>BTW: Wenn du schon auf die WinAPI zurückgreifst um den Desktop-Pfad zu eruieren, kannst du die WinAPI auch gleich fürs Kopieren verwenden: CopyFile()</p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/990976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/990976</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Fri, 10 Feb 2006 14:39:52 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Sat, 11 Feb 2006 12:26:02 GMT]]></title><description><![CDATA[<p>hiho</p>
<p>ich benutzte den CodeBlocks Compiler (v1.0). Doch spuckt bei</p>
<pre><code>TCHAR path[MAX_PATH]; 
	SHGetSpecialFolderPath(0,path,CSIDL_DESKTOPDIRECTORY,false);
	TCHAR path2[MAX_PATH];
	SHGetSpecialFolderPath(0,path2,CSIDL_COMMON_STARTUP,false);&quot;
</code></pre>
<p>immer eine Fehlermeldung aus (undeclared, first use of function).<br />
Weis jemand, wie ich das mit dem codeBlocks Compiler machen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/991464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991464</guid><dc:creator><![CDATA[g3bk47]]></dc:creator><pubDate>Sat, 11 Feb 2006 12:26:02 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Sat, 11 Feb 2006 12:53:51 GMT]]></title><description><![CDATA[<p>Da habe ich schon nochgeschaut. Das einzige, was ich gefunden habe, war:<br />
Header: shellapi.h<br />
Ich habe schon versucht, es mit der shellapi.h von codeblocks und mit der shellapi.h von MS Visual Studio zu kompilieren. Beides ohne erfolg...<br />
Woran liegt der Fehler denn? Denn den selben Quelltext kann ich mit MS Visual Studio C++ porblemlos kompilieren (allerdings kommt dann immer dieses störende &quot;Anmerkung&quot; Fenster.<br />
Freue mich über alle Antworten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/991491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991491</guid><dc:creator><![CDATA[g3bk47]]></dc:creator><pubDate>Sat, 11 Feb 2006 12:53:51 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Sat, 11 Feb 2006 12:54:08 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=10455" rel="nofollow">evilissimo</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" 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/991492</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991492</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sat, 11 Feb 2006 12:54:08 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Sat, 11 Feb 2006 14:53:56 GMT]]></title><description><![CDATA[<p>Wenn ich</p>
<pre><code>TCHAR path[MAX_PATH];
	SHGetSpecialFolderPath(0,path,CSIDL_DESKTOPDIRECTORY,false);
	TCHAR path2[MAX_PATH];
	SHGetSpecialFolderPath(0,path2,CSIDL_COMMON_STARTUP,false);
</code></pre>
<p>über die main datei schreibe kommt die Fehlermeldung:</p>
<pre><code>main.cpp:17: error: expected constructor, destructor, or type conversion before '(' token
main.cpp:17: error: expected `,' or `;' before '(' token
</code></pre>
<p>Ich kireg das einfach nich hin... Weis denn keiner Rat? ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/991608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991608</guid><dc:creator><![CDATA[g3bk47]]></dc:creator><pubDate>Sat, 11 Feb 2006 14:53:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Sat, 11 Feb 2006 16:52:50 GMT]]></title><description><![CDATA[<p>Der Code muss schon in eine Funktion - main oder was auch immer. Das sind aber absolute Grundlagen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/991674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991674</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Sat, 11 Feb 2006 16:52:50 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Sat, 11 Feb 2006 17:28:26 GMT]]></title><description><![CDATA[<p>ja schon, aber inzwischen bin ich so verzweifelt, dass ich alles ausprobiere <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/991694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/991694</guid><dc:creator><![CDATA[g3bk47]]></dc:creator><pubDate>Sat, 11 Feb 2006 17:28:26 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Mon, 13 Feb 2006 09:43:54 GMT]]></title><description><![CDATA[<p>Wie MFK sagte, ausführbarer Code darf nicht frei im Raum rumstehen (sonst weiß der Compiler nicht, wann er den Code aufrufen soll:</p>
<pre><code class="language-cpp">TCHAR path[MAX_PATH];
TCHAR path2[MAX_PATH];
void init_paths()
{
  SHGetSpecialFolderPath(0,path,CSIDL_DESKTOPDIRECTORY,false);
  SHGetSpecialFolderPath(0,path2,CSIDL_COMMON_STARTUP,false);
}

int main()
{
  init_paths();
  ...//weiterer Anwendungscode
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/992867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/992867</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Mon, 13 Feb 2006 09:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Mon, 13 Feb 2006 10:55:47 GMT]]></title><description><![CDATA[<p><a href="http://world-of-dungeons.de/?link_wa_83436" rel="nofollow">http://world-of-dungeons.de/?link_wa_83436</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/992922</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/992922</guid><dc:creator><![CDATA[jkadskgfafdg]]></dc:creator><pubDate>Mon, 13 Feb 2006 10:55:47 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Mon, 13 Feb 2006 13:11:38 GMT]]></title><description><![CDATA[<p>auchda kommt folgende fehlermeldung:</p>
<blockquote>
<p>test/main.cpp:9: error: `SHGetSpecialFolderPath' undeclared (first use this function)</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/993047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/993047</guid><dc:creator><![CDATA[elefant]]></dc:creator><pubDate>Mon, 13 Feb 2006 13:11:38 GMT</pubDate></item><item><title><![CDATA[Reply to Dateien auf Desktop Kopieren on Mon, 13 Feb 2006 13:27:47 GMT]]></title><description><![CDATA[<p>Hast du auch die shellapi.h mit eingebunden? (btw, wenn, dann bitte die Version deines eigenen Compilers)</p>
<p>PS: Was meinstest du eigentlich mit &quot;Anmerkung&quot;-Fenster?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/993063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/993063</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Mon, 13 Feb 2006 13:27:47 GMT</pubDate></item></channel></rss>