<?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[Programmabbruch beim Auslesen von Verzeichnissen]]></title><description><![CDATA[<p>Villeicht bin ich auch grad einfach nur zu blind, aber volgender code verursacht immer die Fehlermeldung</p>
<blockquote>
<p>This application has requested the Runtime to terminate it in an unusual way.<br />
Please contact the application's support team for more information.</p>
</blockquote>
<pre><code class="language-cpp">string find_file( string sPath, string sFileName )
{
	HANDLE fHandle;
	WIN32_FIND_DATA wfd;
	string workPath, TempPath, result;

	workPath = sPath;
	TempPath = sPath;
	workPath.append( &quot;\\*&quot; );

	fHandle = FindFirstFile( workPath.c_str(), &amp;wfd );
	cout &lt;&lt; &quot;I'm in: &quot; &lt;&lt; TempPath &lt;&lt; endl;
	do
	{
    	// Eintrag nur behandeln, wenn es nicht . oder .. ist (werden nur bei Unterverzeichnissen mit zurückgeliefert)
    	// hier könnte man z.B. auch mit lstrcmp auf . und .. vergleichen, was allerdings nicht ganz so effizient ist
    	if (!( (wfd.cFileName[0]=='.') &amp;&amp; ( (wfd.cFileName[1]=='.' &amp;&amp; wfd.cFileName[2]==0) || wfd.cFileName[1]==0 ) ))
    	{
        	if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
        	{
				// Wenn du ein Verzeichnis findest gehe rekursiv auch dieses durch
				// Sollte einer der rekursiven Aufrufe die Datei finden so gib den Pfad zurück
				workPath = TempPath;
				workPath.append( &quot;\\&quot; );
				workPath.append( wfd.cFileName );
				result = find_file( workPath, sFileName );
            	if ( !result.empty( ) )
            		return result;
        	}
        	else
        	{
				// Wenn du die Datei findest, gib den Pfad zurück
				cout &lt;&lt; &quot;&gt;&gt;\t\t&quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
            	if ( !sFileName.compare( wfd.cFileName ) )
            		return sPath;
        	}
    	}
	}
	while ( FindNextFile( fHandle,&amp;wfd ) );
	FindClose( fHandle );

// Wenn du nichts findest gib null zurück
return NULL;
}
</code></pre>
<p>Ich hab das gefühl der letzte aufruf beendet mit return alle laufenden aufrufe ??!!??</p>
<p>Hier nochmaql ne komplette Ausgabe des Programms</p>
<blockquote>
<p>C:\Pfad zum Tool\&gt;Projekt1 -R &quot;C:\Dokumente und Einstellungen&quot; config.tab<br />
I'm in: C:\Dokumente und Einstellungen<br />
I'm in: C:\Dokumente und Einstellungen\a6283<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten</p>
<blockquote>
<p>&gt; desktop.ini<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten\Microsoft<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten\Microsoft\Credentials<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten\Microsoft\Credentials\S-1-5-21-3190323292-537000087-2996414867-56190</p>
</blockquote>
<p>This application has requested the Runtime to terminate it in an unusual way.<br />
Please contact the application's support team for more information.</p>
</blockquote>
<p>PS: Ich hoffe ich bin hier richtig, andernfalls: Tut eure Pflicht, MODs <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/topic/111539/programmabbruch-beim-auslesen-von-verzeichnissen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 26 Jun 2026 21:54:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/111539.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Jun 2005 08:56:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programmabbruch beim Auslesen von Verzeichnissen on Thu, 02 Jun 2005 08:57:37 GMT]]></title><description><![CDATA[<p>Villeicht bin ich auch grad einfach nur zu blind, aber volgender code verursacht immer die Fehlermeldung</p>
<blockquote>
<p>This application has requested the Runtime to terminate it in an unusual way.<br />
Please contact the application's support team for more information.</p>
</blockquote>
<pre><code class="language-cpp">string find_file( string sPath, string sFileName )
{
	HANDLE fHandle;
	WIN32_FIND_DATA wfd;
	string workPath, TempPath, result;

	workPath = sPath;
	TempPath = sPath;
	workPath.append( &quot;\\*&quot; );

	fHandle = FindFirstFile( workPath.c_str(), &amp;wfd );
	cout &lt;&lt; &quot;I'm in: &quot; &lt;&lt; TempPath &lt;&lt; endl;
	do
	{
    	// Eintrag nur behandeln, wenn es nicht . oder .. ist (werden nur bei Unterverzeichnissen mit zurückgeliefert)
    	// hier könnte man z.B. auch mit lstrcmp auf . und .. vergleichen, was allerdings nicht ganz so effizient ist
    	if (!( (wfd.cFileName[0]=='.') &amp;&amp; ( (wfd.cFileName[1]=='.' &amp;&amp; wfd.cFileName[2]==0) || wfd.cFileName[1]==0 ) ))
    	{
        	if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
        	{
				// Wenn du ein Verzeichnis findest gehe rekursiv auch dieses durch
				// Sollte einer der rekursiven Aufrufe die Datei finden so gib den Pfad zurück
				workPath = TempPath;
				workPath.append( &quot;\\&quot; );
				workPath.append( wfd.cFileName );
				result = find_file( workPath, sFileName );
            	if ( !result.empty( ) )
            		return result;
        	}
        	else
        	{
				// Wenn du die Datei findest, gib den Pfad zurück
				cout &lt;&lt; &quot;&gt;&gt;\t\t&quot; &lt;&lt; wfd.cFileName &lt;&lt; endl;
            	if ( !sFileName.compare( wfd.cFileName ) )
            		return sPath;
        	}
    	}
	}
	while ( FindNextFile( fHandle,&amp;wfd ) );
	FindClose( fHandle );

// Wenn du nichts findest gib null zurück
return NULL;
}
</code></pre>
<p>Ich hab das gefühl der letzte aufruf beendet mit return alle laufenden aufrufe ??!!??</p>
<p>Hier nochmaql ne komplette Ausgabe des Programms</p>
<blockquote>
<p>C:\Pfad zum Tool\&gt;Projekt1 -R &quot;C:\Dokumente und Einstellungen&quot; config.tab<br />
I'm in: C:\Dokumente und Einstellungen<br />
I'm in: C:\Dokumente und Einstellungen\a6283<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten</p>
<blockquote>
<p>&gt; desktop.ini<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten\Microsoft<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten\Microsoft\Credentials<br />
I'm in: C:\Dokumente und Einstellungen\a6283\Anwendungsdaten\Microsoft\Credentials\S-1-5-21-3190323292-537000087-2996414867-56190</p>
</blockquote>
<p>This application has requested the Runtime to terminate it in an unusual way.<br />
Please contact the application's support team for more information.</p>
</blockquote>
<p>PS: Ich hoffe ich bin hier richtig, andernfalls: Tut eure Pflicht, MODs <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/800833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/800833</guid><dc:creator><![CDATA[THE_FreaK]]></dc:creator><pubDate>Thu, 02 Jun 2005 08:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to Programmabbruch beim Auslesen von Verzeichnissen on Thu, 02 Jun 2005 12:18:58 GMT]]></title><description><![CDATA[<p>Es liegt daran, dass Du am Ende NULL zurück gibst.<br />
Ändere es zu</p>
<pre><code class="language-cpp">return &quot;&quot;;
</code></pre>
<p>und es läuft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/800984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/800984</guid><dc:creator><![CDATA[Airdamn]]></dc:creator><pubDate>Thu, 02 Jun 2005 12:18:58 GMT</pubDate></item><item><title><![CDATA[Reply to Programmabbruch beim Auslesen von Verzeichnissen on Thu, 02 Jun 2005 12:29:23 GMT]]></title><description><![CDATA[<p>ja super, thx ^^</p>
<p>aberfür son fehler könnt ich mich schon wieder hauen *lol*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/801002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/801002</guid><dc:creator><![CDATA[THE_FreaK]]></dc:creator><pubDate>Thu, 02 Jun 2005 12:29:23 GMT</pubDate></item></channel></rss>