<?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[FtpCommand]]></title><description><![CDATA[<p>Servus,</p>
<p>ich hab schon wieder ein Problem! Folgender Code funktioniert bei mir nicht:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;wininet.h&gt; 
#include &lt;stdio.h&gt; 
#include &lt;stdlib.h&gt;

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    HINTERNET       hIntSession = NULL;
    HINTERNET       hFtpSession = NULL;
    HINTERNET       hFtpCommand = NULL; 

    char buff[4096];
    DWORD dwBytesRead;

    FILE *f;

    hIntSession = InternetOpen (&quot;FTP&quot;, INTERNET_OPEN_TYPE_PRECONFIG,
                                 NULL, NULL, 0) ;

    hFtpSession = InternetConnect (hIntSession, &quot;ftp.tu-darmstadt.de&quot;,
                                    INTERNET_DEFAULT_FTP_PORT,
                                    &quot;anonymous&quot;, &quot;felix.maximus@web.de&quot;,
                                    INTERNET_SERVICE_FTP,                                    
                                    INTERNET_FLAG_PASSIVE,                                    
                                    0) ;   

    BOOL bRet = FtpCommand(hFtpSession, TRUE, FTP_TRANSFER_TYPE_ASCII,&quot;LIST&quot;, 0, &amp;hFtpCommand); 

    bRet = InternetReadFile(hFtpCommand,buff,4095,&amp;dwBytesRead);

    buff[dwBytesRead] = 0;

    f=fopen(&quot;File.txt&quot;,&quot;w+&quot;);
    fprintf(f,&quot;%s\n&quot;,buff);
    fclose(f);

    InternetCloseHandle (hFtpSession) ;
    InternetCloseHandle (hIntSession) ;

    return 0;   
}
</code></pre>
<p>Ich benutze Dev-C++ unter Windows XP. Bei diesem Projekt wurde außerdem noch libwininet.a eingebunden. Der Fehler, der bei mir erscheint lautet:</p>
<pre><code>too many arguments to function `FtpCommandA'
</code></pre>
<p>Und wenn ich den letzten Parameter(hier &amp;hFtpCommand) entferne, kommt der Fehler:</p>
<pre><code>[Linker error] undefined reference to `FtpCommandA@20'
</code></pre>
<p>Was hab ich falsch gemacht? Muss noch irgendeine Datei eingebunden werden?</p>
<p>Danke im Voraus,</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/187736/ftpcommand</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Jul 2026 11:18:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187736.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Jul 2007 15:05:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FtpCommand on Mon, 23 Jul 2007 15:05:36 GMT]]></title><description><![CDATA[<p>Servus,</p>
<p>ich hab schon wieder ein Problem! Folgender Code funktioniert bei mir nicht:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;wininet.h&gt; 
#include &lt;stdio.h&gt; 
#include &lt;stdlib.h&gt;

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    HINTERNET       hIntSession = NULL;
    HINTERNET       hFtpSession = NULL;
    HINTERNET       hFtpCommand = NULL; 

    char buff[4096];
    DWORD dwBytesRead;

    FILE *f;

    hIntSession = InternetOpen (&quot;FTP&quot;, INTERNET_OPEN_TYPE_PRECONFIG,
                                 NULL, NULL, 0) ;

    hFtpSession = InternetConnect (hIntSession, &quot;ftp.tu-darmstadt.de&quot;,
                                    INTERNET_DEFAULT_FTP_PORT,
                                    &quot;anonymous&quot;, &quot;felix.maximus@web.de&quot;,
                                    INTERNET_SERVICE_FTP,                                    
                                    INTERNET_FLAG_PASSIVE,                                    
                                    0) ;   

    BOOL bRet = FtpCommand(hFtpSession, TRUE, FTP_TRANSFER_TYPE_ASCII,&quot;LIST&quot;, 0, &amp;hFtpCommand); 

    bRet = InternetReadFile(hFtpCommand,buff,4095,&amp;dwBytesRead);

    buff[dwBytesRead] = 0;

    f=fopen(&quot;File.txt&quot;,&quot;w+&quot;);
    fprintf(f,&quot;%s\n&quot;,buff);
    fclose(f);

    InternetCloseHandle (hFtpSession) ;
    InternetCloseHandle (hIntSession) ;

    return 0;   
}
</code></pre>
<p>Ich benutze Dev-C++ unter Windows XP. Bei diesem Projekt wurde außerdem noch libwininet.a eingebunden. Der Fehler, der bei mir erscheint lautet:</p>
<pre><code>too many arguments to function `FtpCommandA'
</code></pre>
<p>Und wenn ich den letzten Parameter(hier &amp;hFtpCommand) entferne, kommt der Fehler:</p>
<pre><code>[Linker error] undefined reference to `FtpCommandA@20'
</code></pre>
<p>Was hab ich falsch gemacht? Muss noch irgendeine Datei eingebunden werden?</p>
<p>Danke im Voraus,</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1330912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1330912</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Mon, 23 Jul 2007 15:05:36 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Mon, 23 Jul 2007 15:11:47 GMT]]></title><description><![CDATA[<p>ich weis nicht was es mit libwininet.a auf sich hat bei Visual 2005 muss man noch WININET.LIB linken</p>
<p>mfg noha</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1330915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1330915</guid><dc:creator><![CDATA[noha_391]]></dc:creator><pubDate>Mon, 23 Jul 2007 15:11:47 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Mon, 23 Jul 2007 15:52:44 GMT]]></title><description><![CDATA[<p>Ich glaube, dass libwininet.a der WININET.LIB entspricht, aber ich hab's versucht und es hat nicht funktioniert. Das Einbinden einer lib-Datei funktioniert doch so oder:</p>
<pre><code>#pragma comment(lib, &quot;WININET.LIB&quot;)
</code></pre>
<p>oder hab ich da einen Fehler gemacht?</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1330948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1330948</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Mon, 23 Jul 2007 15:52:44 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Mon, 23 Jul 2007 18:04:17 GMT]]></title><description><![CDATA[<p>Ich würde spontan mal einfach auf einen Fehler in der libwininet.a tippen.<br />
Hast du die aktuellen w32api drauf?<br />
<a href="http://downloads.sourceforge.net/mingw/w32api-3.9.tar.gz?modtime=1174905073&amp;big_mirror=1" rel="nofollow">http://downloads.sourceforge.net/mingw/w32api-3.9.tar.gz?modtime=1174905073&amp;big_mirror=1</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1331040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1331040</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Mon, 23 Jul 2007 18:04:17 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Tue, 24 Jul 2007 12:34:29 GMT]]></title><description><![CDATA[<p>War ne gute Idee, aber hat nicht funktioniert!<br />
Trotzdem danke.</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1331507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1331507</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Tue, 24 Jul 2007 12:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Tue, 24 Jul 2007 12:37:35 GMT]]></title><description><![CDATA[<p>das mit dem linken ist so richtig <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="😉"
    /><br />
dann kann ich dir leider nicht weiterhelfen <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="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1331509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1331509</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Tue, 24 Jul 2007 12:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Tue, 24 Jul 2007 14:46:33 GMT]]></title><description><![CDATA[<p>Wo muss sich die WININET.LIB befinden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1331642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1331642</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Tue, 24 Jul 2007 14:46:33 GMT</pubDate></item><item><title><![CDATA[Reply to FtpCommand on Tue, 24 Jul 2007 19:01:42 GMT]]></title><description><![CDATA[<p>Im PlatformSDK bzw. im &quot;Windows SDK&quot; oder teilweise auch mitgeliefert bei Microsoft-Entwicklungsumgebungen. Allerdings wirst du damit bei mingw nicht viel anfangen können (d.h. man kann daraus wohl ne libwininet.a die mingw braucht mittels irgendnem tool erzeugen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1331791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1331791</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Tue, 24 Jul 2007 19:01:42 GMT</pubDate></item></channel></rss>