<?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[FindFirstFileW &#x2F; FindNextFileW: Problem]]></title><description><![CDATA[<p>Hallo Leute.</p>
<p>Ich möchte ein Unicode-fähiges Prog erstellen, darum habe ich den code wie folgt gestaltet:</p>
<pre><code class="language-cpp">{
	WIN32_FIND_DATAW findData;

	HANDLE hFind = FindFirstFileW(lpDirectory, &amp;findData);

	if (hFind == NULL)
		return;

	do
	{
		if (findData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
		{
			MessageBoxW(NULL, findData.cFileName, L&quot;Fehler&quot;, MB_OK);
		}
	}
	while (FindNextFileW(hFind, &amp;findData));
}
</code></pre>
<p>Aber das Problem ist, dass die MessageBox gar nicht erst erscheint, ob wohl das Verzeichnis korrekt angegeben wird, aber wenn ich die If-Anweisung entferne, erscheint eine MessageBox mit kryptischen Zeichen.</p>
<p>Was kann ich tun?</p>
<p>VIelen Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203106/findfirstfilew-findnextfilew-problem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Apr 2026 20:52:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203106.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Jan 2008 18:37:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FindFirstFileW &#x2F; FindNextFileW: Problem on Fri, 18 Jan 2008 18:37:14 GMT]]></title><description><![CDATA[<p>Hallo Leute.</p>
<p>Ich möchte ein Unicode-fähiges Prog erstellen, darum habe ich den code wie folgt gestaltet:</p>
<pre><code class="language-cpp">{
	WIN32_FIND_DATAW findData;

	HANDLE hFind = FindFirstFileW(lpDirectory, &amp;findData);

	if (hFind == NULL)
		return;

	do
	{
		if (findData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
		{
			MessageBoxW(NULL, findData.cFileName, L&quot;Fehler&quot;, MB_OK);
		}
	}
	while (FindNextFileW(hFind, &amp;findData));
}
</code></pre>
<p>Aber das Problem ist, dass die MessageBox gar nicht erst erscheint, ob wohl das Verzeichnis korrekt angegeben wird, aber wenn ich die If-Anweisung entferne, erscheint eine MessageBox mit kryptischen Zeichen.</p>
<p>Was kann ich tun?</p>
<p>VIelen Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439197</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439197</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Fri, 18 Jan 2008 18:37:14 GMT</pubDate></item><item><title><![CDATA[Reply to FindFirstFileW &#x2F; FindNextFileW: Problem on Fri, 18 Jan 2008 20:18:13 GMT]]></title><description><![CDATA[<p>Bau das mal um dann sollte es laufen</p>
<pre><code class="language-cpp">{
	WIN32_FIND_DATAW findData;
         BOOL Next;

	HANDLE hFind = FindFirstFileW(lpDirectory, &amp;findData);

	if (hFind == NULL)
		return;

	do
	{
                  Next = FindNextFileW(hFind, &amp;findData));
		if (findData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
		{
			MessageBoxW(NULL, findData.cFileName, L&quot;Fehler&quot;, MB_OK);
		}
	}
	while (Next)
}
</code></pre>
<p>is auch so in der MSDN beschrieben</p>
<p>Gruß Matthias</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439233</guid><dc:creator><![CDATA[CTecS]]></dc:creator><pubDate>Fri, 18 Jan 2008 20:18:13 GMT</pubDate></item><item><title><![CDATA[Reply to FindFirstFileW &#x2F; FindNextFileW: Problem on Fri, 18 Jan 2008 20:30:33 GMT]]></title><description><![CDATA[<p>die ersten 2 files die du findest sind<br />
'.' und '..'</p>
<p>du musst als insgesamt 3x lesen bis du die erste datei hast in dem verzeichnis.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439235</guid><dc:creator><![CDATA[asdfsfdasd]]></dc:creator><pubDate>Fri, 18 Jan 2008 20:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to FindFirstFileW &#x2F; FindNextFileW: Problem on Fri, 18 Jan 2008 20:34:55 GMT]]></title><description><![CDATA[<p>Also ich persönlich würde ja Linux nehmen, nur echt mit dem GNU-Qualitätssiegel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1439237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439237</guid><dc:creator><![CDATA[alsoichpers.]]></dc:creator><pubDate>Fri, 18 Jan 2008 20:34:55 GMT</pubDate></item><item><title><![CDATA[Reply to FindFirstFileW &#x2F; FindNextFileW: Problem on Fri, 18 Jan 2008 21:07:36 GMT]]></title><description><![CDATA[<ol>
<li>lpDirectory muss eine Dateimaske enthalten, ansonsten wird nur ein Treffer gefunden.</li>
<li>Im Fehlerfall gibt FindFirstFile den Wert INVALID_HANDLE_VALUE zurück und nicht NULL.</li>
<li>Das FindClose fehlt.</li>
</ol>
<pre><code class="language-cpp">WIN32_FIND_DATAW findData; 

	HANDLE hFind = FindFirstFileW(L&quot;C:\\*.*&quot;, &amp;findData); 
	if (INVALID_HANDLE_VALUE != hFind)
	{
		do 
		{ 
			if (findData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) 
			{ 
				MessageBoxW(NULL, findData.cFileName, L&quot;Fehler&quot;, MB_OK); 
			} 
		} 
		while (FindNextFileW(hFind, &amp;findData)); 

		FindClose(hFind);
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1439248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1439248</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Fri, 18 Jan 2008 21:07:36 GMT</pubDate></item></channel></rss>