<?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[FtpSetCurrentDirectory liefert GetLastError 997 ???]]></title><description><![CDATA[<p>Hi nochmal <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="🙂"
    /><br />
Mein Code:</p>
<pre><code>if(hInternetOpen = InternetOpen(_T(&quot;TestAgent&quot;),
									INTERNET_OPEN_TYPE_DIRECT,
									NULL,
									NULL,
									INTERNET_FLAG_ASYNC)) {

			if(hFtpConnect=InternetConnect (hInternetOpen,
										   _T(&quot;10.64.1.22&quot;),
											INTERNET_DEFAULT_FTP_PORT,
											_T(&quot;Mobile&quot;),
											_T(&quot;Device&quot;),
											INTERNET_SERVICE_FTP,
											NULL,
											NULL)) {

					if(FtpSetCurrentDirectory(hFtpConnect, _T(&quot;\/FtpVerladen&quot;))) 
					{
						FtpGetCurrentDirectory(hFtpConnect,cs_remotefile.GetBuffer(256),0);
						cs_remotefile.ReleaseBuffer();
						cs_remotefile += cs_ladeliste + &quot;_verladen.txt&quot;;
					}
					else 
					{
						DWORD dw_error = GetLastError();
						MessageBox(_T(&quot;Das Zielverzeichnis auf dem FTP wurde nicht gefunden&quot;),_T(&quot;Fehler&quot;),MB_OK);
					}

					if (FtpPutFile(hFtpConnect,
									cs_localfile,
									cs_remotefile,
									INTERNET_FLAG_TRANSFER_BINARY,
									NULL)) {
						MessageBox(_T(&quot;Die Buchung wurde erfolgreich übertragen&quot;),_T(&quot;Fertig&quot;),MB_OK);
					}
					else {MessageBox(_T(&quot;Es gab einen Fehler beim Abschliessen der Buchung!&quot;),_T(&quot;Fehler!&quot;),MB_OK);}

					InternetCloseHandle(hInternetOpen);
					InternetCloseHandle(hFtpConnect);
</code></pre>
<p>Mein Problem: Der Debugger liefert:<br />
hFtpConnect = 0x00cc0008<br />
hInternetOpen = 0x00cc0004<br />
Soweit so gut. Nun bringt er aber bei FtpSetCurrentDirectory den System_Error-Code 997 über GetLastError:</p>
<p>[quote]<br />
ERROR_IO_PENDING Overlapped I/O operation is in progress.<br />
997<br />
[/qote]<br />
Ich verstehe aber nicht warum. Ich habe den Ordner in den es wechseln soll bereit ohne Slashs, mit &quot;\\bla&quot; und &quot;\/bla&quot; angegeben und er existiert auch wirklich. Die rechte sind für &quot;/&quot; und alle Unterordner freigegeben bis auf execute. Das Stammverzeichnis des FTP-Users ist &quot;C:\FTP&quot;, ist aber nicht darauf beschränkt, aber der User hat nur in diesem Ordner und dessen Unterordner Rechte.<br />
Ich weis echt nicht mehr wo das Problem liegen könnte. Die FTP-Verbindung wird ja erfolgreich aufgebaut und alles... <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="😞"
    /><br />
Weis jemadn Rat?<br />
Schöne Grüße<br />
Basti <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/topic/199119/ftpsetcurrentdirectory-liefert-getlasterror-997</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 17:07:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/199119.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Nov 2007 08:06:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FtpSetCurrentDirectory liefert GetLastError 997 ??? on Thu, 29 Nov 2007 08:06:02 GMT]]></title><description><![CDATA[<p>Hi nochmal <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="🙂"
    /><br />
Mein Code:</p>
<pre><code>if(hInternetOpen = InternetOpen(_T(&quot;TestAgent&quot;),
									INTERNET_OPEN_TYPE_DIRECT,
									NULL,
									NULL,
									INTERNET_FLAG_ASYNC)) {

			if(hFtpConnect=InternetConnect (hInternetOpen,
										   _T(&quot;10.64.1.22&quot;),
											INTERNET_DEFAULT_FTP_PORT,
											_T(&quot;Mobile&quot;),
											_T(&quot;Device&quot;),
											INTERNET_SERVICE_FTP,
											NULL,
											NULL)) {

					if(FtpSetCurrentDirectory(hFtpConnect, _T(&quot;\/FtpVerladen&quot;))) 
					{
						FtpGetCurrentDirectory(hFtpConnect,cs_remotefile.GetBuffer(256),0);
						cs_remotefile.ReleaseBuffer();
						cs_remotefile += cs_ladeliste + &quot;_verladen.txt&quot;;
					}
					else 
					{
						DWORD dw_error = GetLastError();
						MessageBox(_T(&quot;Das Zielverzeichnis auf dem FTP wurde nicht gefunden&quot;),_T(&quot;Fehler&quot;),MB_OK);
					}

					if (FtpPutFile(hFtpConnect,
									cs_localfile,
									cs_remotefile,
									INTERNET_FLAG_TRANSFER_BINARY,
									NULL)) {
						MessageBox(_T(&quot;Die Buchung wurde erfolgreich übertragen&quot;),_T(&quot;Fertig&quot;),MB_OK);
					}
					else {MessageBox(_T(&quot;Es gab einen Fehler beim Abschliessen der Buchung!&quot;),_T(&quot;Fehler!&quot;),MB_OK);}

					InternetCloseHandle(hInternetOpen);
					InternetCloseHandle(hFtpConnect);
</code></pre>
<p>Mein Problem: Der Debugger liefert:<br />
hFtpConnect = 0x00cc0008<br />
hInternetOpen = 0x00cc0004<br />
Soweit so gut. Nun bringt er aber bei FtpSetCurrentDirectory den System_Error-Code 997 über GetLastError:</p>
<p>[quote]<br />
ERROR_IO_PENDING Overlapped I/O operation is in progress.<br />
997<br />
[/qote]<br />
Ich verstehe aber nicht warum. Ich habe den Ordner in den es wechseln soll bereit ohne Slashs, mit &quot;\\bla&quot; und &quot;\/bla&quot; angegeben und er existiert auch wirklich. Die rechte sind für &quot;/&quot; und alle Unterordner freigegeben bis auf execute. Das Stammverzeichnis des FTP-Users ist &quot;C:\FTP&quot;, ist aber nicht darauf beschränkt, aber der User hat nur in diesem Ordner und dessen Unterordner Rechte.<br />
Ich weis echt nicht mehr wo das Problem liegen könnte. Die FTP-Verbindung wird ja erfolgreich aufgebaut und alles... <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="😞"
    /><br />
Weis jemadn Rat?<br />
Schöne Grüße<br />
Basti <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/1412007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1412007</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Thu, 29 Nov 2007 08:06:02 GMT</pubDate></item><item><title><![CDATA[Reply to FtpSetCurrentDirectory liefert GetLastError 997 ??? on Fri, 30 Nov 2007 10:37:04 GMT]]></title><description><![CDATA[<p>Keiner eine Idee?<br />
Gruß Basti</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1412596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1412596</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 30 Nov 2007 10:37:04 GMT</pubDate></item><item><title><![CDATA[Reply to FtpSetCurrentDirectory liefert GetLastError 997 ??? on Fri, 30 Nov 2007 10:28:45 GMT]]></title><description><![CDATA[<p>Okay, für die die es interessiert/dasselbe Problem haben:<br />
FtpSetCurrentDirectory kann zwar den Errorcode &quot;977&quot; ausgeben, was aber nicht heist, dass es nicht erfolgreich ist. Dieser fehler besagt (auch wenn das nicht ersichtlich ist), dass im Moment ein anderer I/O Prozess läuft, und dass FtpSetCurrentDirectory hintangestellt wird, also trotzdem noch ausgeführt wird.<br />
Das gestaltet aber meiner Meinung nach die Fehlerbehandlung etwas komplexer. Entweder man filtert dw_error 977 raus und beachtet es nicht, oder man prüft mittels FtpGetCurrentDirectory ob am Ende irgendwo das Verzeichnis enthalten ist, in das das Programm wechseln sollte.</p>
<p>Gruß Basti</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1412769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1412769</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 30 Nov 2007 10:28:45 GMT</pubDate></item><item><title><![CDATA[Reply to FtpSetCurrentDirectory liefert GetLastError 997 ??? on Fri, 30 Nov 2007 11:01:20 GMT]]></title><description><![CDATA[<p>Au weia.</p>
<p>Man könnte natürlich auch einfach INTERNET_FLAG_ASYNC weglassen, wenn man mit asynchronen Funktionen nicht klarkommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1412793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1412793</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Fri, 30 Nov 2007 11:01:20 GMT</pubDate></item><item><title><![CDATA[Reply to FtpSetCurrentDirectory liefert GetLastError 997 ??? on Fri, 30 Nov 2007 13:17:03 GMT]]></title><description><![CDATA[<p>hab ich gemacht --&gt; selber fehler</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1412912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1412912</guid><dc:creator><![CDATA[sebastian87]]></dc:creator><pubDate>Fri, 30 Nov 2007 13:17:03 GMT</pubDate></item></channel></rss>