<?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[Rekursion funktioniert nicht]]></title><description><![CDATA[<p>N'abend</p>
<p>ich habe eine Rekursion erstellt, die einen Pfad durchsucht.</p>
<p>Das Problem ist, dass irgendwelche Speicherlecks auftreten.</p>
<pre><code class="language-cpp">void RecursiveSearch(LPWSTR lpPath, LPWSTR lpFilter, LPWSTR lpDestination)
{
	WCHAR search[MAX_PATH + 1];
	lstrcpy(search, lpPath);
	if (search[wcslen(search) - 1] != L'\\')
		lstrcat(search, L&quot;\\&quot;);
	lstrcat(search, lpFilter);

	WIN32_FIND_DATA findData;
	HANDLE hFind = FindFirstFile(search, &amp;findData);
	WCHAR path[MAX_PATH + 1];

	do
	{
		if ((findData.cFileName[0] != L'.') ||
			((lstrlen(findData.cFileName) &gt; 1) &amp;&amp; (findData.cFileName[0] != L'.')) ||
			(lstrlen(findData.cFileName) &gt; 2))
		{
			lstrcpy(path, lpPath);
			if (path[wcslen(path) - 1] != L'\\')
				lstrcat(path, L&quot;\\&quot;);
			lstrcat(path, findData.cFileName);

			if (findData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
			{
				RecursiveSearch(path, lpFilter, lpDestination);
			}
			else
			{
				MoveFound(path, lpDestination);
			}
		}
	}
	while (FindNextFile(hFind, &amp;findData));
}
</code></pre>
<p>Vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203519/rekursion-funktioniert-nicht</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 05:05:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203519.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Jan 2008 16:01:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Rekursion funktioniert nicht on Wed, 23 Jan 2008 16:01:24 GMT]]></title><description><![CDATA[<p>N'abend</p>
<p>ich habe eine Rekursion erstellt, die einen Pfad durchsucht.</p>
<p>Das Problem ist, dass irgendwelche Speicherlecks auftreten.</p>
<pre><code class="language-cpp">void RecursiveSearch(LPWSTR lpPath, LPWSTR lpFilter, LPWSTR lpDestination)
{
	WCHAR search[MAX_PATH + 1];
	lstrcpy(search, lpPath);
	if (search[wcslen(search) - 1] != L'\\')
		lstrcat(search, L&quot;\\&quot;);
	lstrcat(search, lpFilter);

	WIN32_FIND_DATA findData;
	HANDLE hFind = FindFirstFile(search, &amp;findData);
	WCHAR path[MAX_PATH + 1];

	do
	{
		if ((findData.cFileName[0] != L'.') ||
			((lstrlen(findData.cFileName) &gt; 1) &amp;&amp; (findData.cFileName[0] != L'.')) ||
			(lstrlen(findData.cFileName) &gt; 2))
		{
			lstrcpy(path, lpPath);
			if (path[wcslen(path) - 1] != L'\\')
				lstrcat(path, L&quot;\\&quot;);
			lstrcat(path, findData.cFileName);

			if (findData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
			{
				RecursiveSearch(path, lpFilter, lpDestination);
			}
			else
			{
				MoveFound(path, lpDestination);
			}
		}
	}
	while (FindNextFile(hFind, &amp;findData));
}
</code></pre>
<p>Vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442117</guid><dc:creator><![CDATA[Code:)]]></dc:creator><pubDate>Wed, 23 Jan 2008 16:01:24 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursion funktioniert nicht on Wed, 23 Jan 2008 16:55:12 GMT]]></title><description><![CDATA[<p>&quot;irgendwelche speicherlecks&quot;.. das sind ja mal richtig geile fehlerbeschreibungen. da kann dir jeder sofort helfen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442161</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Wed, 23 Jan 2008 16:55:12 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursion funktioniert nicht on Wed, 23 Jan 2008 17:03:06 GMT]]></title><description><![CDATA[<p>Wenn Du Resourcen anforderst (vom OS), dann müssen die wieder freigegeben werden, wenn sie nicht mehr benötigt werden:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/aa364418.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/aa364418.aspx</a></p>
<p>FindFirstFile erfordert ein FindClose !!!</p>
<p>Simon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442170</guid><dc:creator><![CDATA[simon.gysi]]></dc:creator><pubDate>Wed, 23 Jan 2008 17:03:06 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursion funktioniert nicht on Wed, 23 Jan 2008 17:51:50 GMT]]></title><description><![CDATA[<p>Gut, sry.</p>
<p>Das FindClose habe ich hinzugefügt.<br />
Der Fehler tritt bei FindNextFile auf. ich weiß wirklich nicht, woran es denn liegen könnte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442209</guid><dc:creator><![CDATA[Code:)]]></dc:creator><pubDate>Wed, 23 Jan 2008 17:51:50 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursion funktioniert nicht on Thu, 24 Jan 2008 15:31:19 GMT]]></title><description><![CDATA[<blockquote>
<p>Der Fehler tritt bei FindNextFile auf. ich weiß wirklich nicht, woran es denn liegen könnte.</p>
</blockquote>
<p>Welcher Fehler... beschreibe das genauer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442869</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442869</guid><dc:creator><![CDATA[simon.gysi]]></dc:creator><pubDate>Thu, 24 Jan 2008 15:31:19 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursion funktioniert nicht on Thu, 24 Jan 2008 15:34:34 GMT]]></title><description><![CDATA[<p>Ev. sind falsch od. nicht NULL- terminierte strings dafür (wofür???) verantwortlich...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442871</guid><dc:creator><![CDATA[simon.gysi]]></dc:creator><pubDate>Thu, 24 Jan 2008 15:34:34 GMT</pubDate></item></channel></rss>