<?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[in einem ordner alle dateien anzeigen]]></title><description><![CDATA[<p>hallo,<br />
wie der titel schon sagt, will ich all dateien in einem ordner auflisten.<br />
ansatzweise ist mir das schon klar. geholfen hat da der thread: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39396.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39396.html</a><br />
nun, das kleine problem ist, dass es leider bei mir nicht funktioniert. bei mir kommt immer : 'FindFirstFileW' : cannot convert parameter 1 from 'const char [5]' to 'LPCWSTR'</p>
<pre><code class="language-cpp">void findAllFiles(string cpath) {
	WIN32_FIND_DATA wfd;
	HANDLE fHandle = INVALID_HANDLE_VALUE;

	wstring wpath = s2w(cpath);
	cout &lt;&lt; &quot;&gt; Look in: &quot; &lt;&lt; wpath.c_str() &lt;&lt; endl;
//	fHandle = FindFirstFile(wpath.c_str(), &amp;wfd);
	fHandle = FindFirstFile(&quot;C:\\*&quot;, &amp;wfd);
	if(fHandle == INVALID_HANDLE_VALUE) {
		cout &lt;&lt; &quot;Error: invalid path&quot; &lt;&lt; endl;
		return;
	}

	cout &lt;&lt; &quot;*** begin of file list ***&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;&gt; startpoint: &quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
	while(FindNextFile(fHandle, &amp;wfd)) {
		cout &lt;&lt; &quot;...&quot; &lt;&lt; endl;
		if(wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) {
			cout &lt;&lt; &quot;Directory: &quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
		} else {
			cout &lt;&lt; &quot;File: &quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
		}
	}
	cout &lt;&lt; &quot;*** end of file list ***&quot; &lt;&lt; endl;
	FindClose(fHandle);
}
</code></pre>
<p>aus debug gründen hab ich als suchverzeichnis &quot;c:\*&quot; angegeben.</p>
<p>ps: ich hätte ja gerne in dem thread geantwortet, nur war das leider nicht möglich. warum auch immer... ich hoffe, ihr verzeiht mir, dass ich einen neuen auf mache.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/242130/in-einem-ordner-alle-dateien-anzeigen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 20:41:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/242130.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 30 May 2009 20:00:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to in einem ordner alle dateien anzeigen on Sat, 30 May 2009 20:00:48 GMT]]></title><description><![CDATA[<p>hallo,<br />
wie der titel schon sagt, will ich all dateien in einem ordner auflisten.<br />
ansatzweise ist mir das schon klar. geholfen hat da der thread: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39396.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39396.html</a><br />
nun, das kleine problem ist, dass es leider bei mir nicht funktioniert. bei mir kommt immer : 'FindFirstFileW' : cannot convert parameter 1 from 'const char [5]' to 'LPCWSTR'</p>
<pre><code class="language-cpp">void findAllFiles(string cpath) {
	WIN32_FIND_DATA wfd;
	HANDLE fHandle = INVALID_HANDLE_VALUE;

	wstring wpath = s2w(cpath);
	cout &lt;&lt; &quot;&gt; Look in: &quot; &lt;&lt; wpath.c_str() &lt;&lt; endl;
//	fHandle = FindFirstFile(wpath.c_str(), &amp;wfd);
	fHandle = FindFirstFile(&quot;C:\\*&quot;, &amp;wfd);
	if(fHandle == INVALID_HANDLE_VALUE) {
		cout &lt;&lt; &quot;Error: invalid path&quot; &lt;&lt; endl;
		return;
	}

	cout &lt;&lt; &quot;*** begin of file list ***&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;&gt; startpoint: &quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
	while(FindNextFile(fHandle, &amp;wfd)) {
		cout &lt;&lt; &quot;...&quot; &lt;&lt; endl;
		if(wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) {
			cout &lt;&lt; &quot;Directory: &quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
		} else {
			cout &lt;&lt; &quot;File: &quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
		}
	}
	cout &lt;&lt; &quot;*** end of file list ***&quot; &lt;&lt; endl;
	FindClose(fHandle);
}
</code></pre>
<p>aus debug gründen hab ich als suchverzeichnis &quot;c:\*&quot; angegeben.</p>
<p>ps: ich hätte ja gerne in dem thread geantwortet, nur war das leider nicht möglich. warum auch immer... ich hoffe, ihr verzeiht mir, dass ich einen neuen auf mache.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718411</guid><dc:creator><![CDATA[lassmirandadennsivillia]]></dc:creator><pubDate>Sat, 30 May 2009 20:00:48 GMT</pubDate></item><item><title><![CDATA[Reply to in einem ordner alle dateien anzeigen on Sat, 30 May 2009 20:35:50 GMT]]></title><description><![CDATA[<p>schonma was von unicode gehört? find den rest halt selbst raus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718424</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718424</guid><dc:creator><![CDATA[ichiban]]></dc:creator><pubDate>Sat, 30 May 2009 20:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to in einem ordner alle dateien anzeigen on Sat, 30 May 2009 22:42:47 GMT]]></title><description><![CDATA[<p>ichiban schrieb:</p>
<blockquote>
<p>schonma was von unicode gehört? find den rest halt selbst raus</p>
</blockquote>
<p>mh... irgendwie nicht sehr hilfreich. von unicode hab ich schon was gehört. aber in welchem zusammenhang steht das zu meiner frage?? mein beispielcode ist an den wichtigen stellen exakt identisch....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718479</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718479</guid><dc:creator><![CDATA[lassmirandadennsivillia]]></dc:creator><pubDate>Sat, 30 May 2009 22:42:47 GMT</pubDate></item><item><title><![CDATA[Reply to in einem ordner alle dateien anzeigen on Sat, 30 May 2009 22:51:18 GMT]]></title><description><![CDATA[<p>nagut will mal ned so sein mach vor das &quot;C:\*&quot; ein L also L&quot;C:\*&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1718482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718482</guid><dc:creator><![CDATA[ichiban]]></dc:creator><pubDate>Sat, 30 May 2009 22:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to in einem ordner alle dateien anzeigen on Sun, 31 May 2009 10:33:15 GMT]]></title><description><![CDATA[<p>ok, danke <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/1718565</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1718565</guid><dc:creator><![CDATA[lassmirandadennsivillia]]></dc:creator><pubDate>Sun, 31 May 2009 10:33:15 GMT</pubDate></item></channel></rss>