<?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[WinInet &#x2F; HttpSendRequest]]></title><description><![CDATA[<p>checkt mal kurz folgenden code:</p>
<pre><code class="language-cpp">#include &lt;windows&gt;
#include &lt;wininet&gt;
#include &lt;fstream&gt;

using namespace std;

int err(char* fkt)
{
	int e = GetLastError();
	char buffer[256];
	wsprintf(buffer, &quot;Error %i&quot;, e);
	if(e != 0) MessageBox(NULL, fkt, buffer, MB_OK | MB_ICONEXCLAMATION);
	return -1;
}

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hCallerInst, LPSTR lpszCommandLine, int iCount)
{
	HINTERNET hInternet = InternetOpen(&quot;Test/1.0&quot;, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC);
	if(! hInternet) err(&quot;InternetOpen&quot;);

	HINTERNET hInternetSite = InternetConnect(hInternet, &quot;www.keine-ahnung.de&quot;, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, NULL, 0);
	if(! hInternetSite) err(&quot;InternetConnect&quot;);

	HINTERNET hInternetSiteRequest = HttpOpenRequest(hInternetSite, &quot;GET&quot;, &quot;/&quot;, NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0);
	if(! hInternetSiteRequest) err(&quot;HttpOpenRequest&quot;);

	bool b = HttpSendRequest(hInternetSiteRequest, NULL, 0, NULL, 0);
	if(! b) err(&quot;HttpSendRequest&quot;);

	char buffer[1024];
	DWORD dwRead;
	if(! InternetReadFile(hInternetSiteRequest, buffer, 1023, &amp;dwRead)) err(&quot;InternetReadFile&quot;);

	InternetCloseHandle(hInternetSiteRequest);
	InternetCloseHandle(hInternetSite);
	InternetCloseHandle(hInternet);

	buffer[dwRead] = 0;
	ofstream hDatei(&quot;output.html&quot;);
	hDatei &lt;&lt; buffer;
	hDatei.close();

	return 0;
}
</code></pre>
<p>so, in &quot;output.html&quot; hab ich tatsächlich den korrekten inhalt stehen, aber trotzdem gibt HttpSendRequest() false zurück, denn ich erhalte:</p>
<pre><code>Error 997
HttpSendRequest
</code></pre>
<p>laut system-error-code-tabelle heißt 997: &quot;Overlapped I/O operation is in progress.&quot;</p>
<p>was heißt das ? ist das schlimm? und vor allem: was tu ich dagegen ?</p>
<p>danke im vor*aus<br />
lw</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/67286/wininet-httpsendrequest</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 05:02:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/67286.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Mar 2004 21:48:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WinInet &#x2F; HttpSendRequest on Sat, 06 Mar 2004 21:48:56 GMT]]></title><description><![CDATA[<p>checkt mal kurz folgenden code:</p>
<pre><code class="language-cpp">#include &lt;windows&gt;
#include &lt;wininet&gt;
#include &lt;fstream&gt;

using namespace std;

int err(char* fkt)
{
	int e = GetLastError();
	char buffer[256];
	wsprintf(buffer, &quot;Error %i&quot;, e);
	if(e != 0) MessageBox(NULL, fkt, buffer, MB_OK | MB_ICONEXCLAMATION);
	return -1;
}

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hCallerInst, LPSTR lpszCommandLine, int iCount)
{
	HINTERNET hInternet = InternetOpen(&quot;Test/1.0&quot;, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC);
	if(! hInternet) err(&quot;InternetOpen&quot;);

	HINTERNET hInternetSite = InternetConnect(hInternet, &quot;www.keine-ahnung.de&quot;, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, NULL, 0);
	if(! hInternetSite) err(&quot;InternetConnect&quot;);

	HINTERNET hInternetSiteRequest = HttpOpenRequest(hInternetSite, &quot;GET&quot;, &quot;/&quot;, NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0);
	if(! hInternetSiteRequest) err(&quot;HttpOpenRequest&quot;);

	bool b = HttpSendRequest(hInternetSiteRequest, NULL, 0, NULL, 0);
	if(! b) err(&quot;HttpSendRequest&quot;);

	char buffer[1024];
	DWORD dwRead;
	if(! InternetReadFile(hInternetSiteRequest, buffer, 1023, &amp;dwRead)) err(&quot;InternetReadFile&quot;);

	InternetCloseHandle(hInternetSiteRequest);
	InternetCloseHandle(hInternetSite);
	InternetCloseHandle(hInternet);

	buffer[dwRead] = 0;
	ofstream hDatei(&quot;output.html&quot;);
	hDatei &lt;&lt; buffer;
	hDatei.close();

	return 0;
}
</code></pre>
<p>so, in &quot;output.html&quot; hab ich tatsächlich den korrekten inhalt stehen, aber trotzdem gibt HttpSendRequest() false zurück, denn ich erhalte:</p>
<pre><code>Error 997
HttpSendRequest
</code></pre>
<p>laut system-error-code-tabelle heißt 997: &quot;Overlapped I/O operation is in progress.&quot;</p>
<p>was heißt das ? ist das schlimm? und vor allem: was tu ich dagegen ?</p>
<p>danke im vor*aus<br />
lw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/474720</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474720</guid><dc:creator><![CDATA[Lawilog]]></dc:creator><pubDate>Sat, 06 Mar 2004 21:48:56 GMT</pubDate></item><item><title><![CDATA[Reply to WinInet &#x2F; HttpSendRequest on Sun, 07 Mar 2004 09:44:42 GMT]]></title><description><![CDATA[<p>wenn ich die zeile auskommentiere:</p>
<pre><code class="language-cpp">//if(! b) err(&quot;HttpSendRequest&quot;);
</code></pre>
<p>, dann steht in der ausgabe-datei plötzlich gar nix mehr. da geht doch was nicht mit rechten dingen zu. kann das mal jemand je sich compilieren, und mir sagen, was bei ihm passiert ? oder vielleicht sieht ja jemand auch so einen fehler im code.</p>
<p>bitte helft mir, ich verzweifel sonst. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>lw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/474853</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474853</guid><dc:creator><![CDATA[Lawilog]]></dc:creator><pubDate>Sun, 07 Mar 2004 09:44:42 GMT</pubDate></item><item><title><![CDATA[Reply to WinInet &#x2F; HttpSendRequest on Sun, 07 Mar 2004 09:54:56 GMT]]></title><description><![CDATA[<p>Ist doch logisch: Du öffnest mit dem INTERNET_FLAG_ASYNC. Damit kehrt HttpSendRequest sofort zurück. Hättest Du mal GetLastError aufgerufen, hättest Du den Fehler 997 gesehen. Damit ist klar, daß der Request noch nicht abgeschlossen ist.</p>
<p>Du willst das asynchrone Feature gar nicht verwenden, also weg mit dem Flag.</p>
<p>&lt;winerror.h&gt; schrieb:</p>
<blockquote>
<pre><code class="language-cpp">//
// MessageId: ERROR_IO_PENDING
//
// MessageText:
//
//  Overlapped I/O operation is in progress.
//
#define ERROR_IO_PENDING                 997L    // dderror
</code></pre>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/474856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474856</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Sun, 07 Mar 2004 09:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to WinInet &#x2F; HttpSendRequest on Sun, 07 Mar 2004 10:15:21 GMT]]></title><description><![CDATA[<p>ich hab doch GetLastError() aufgerufen ! und ich hab auch den Fehler 997 erhalten. hab ich doch geschrieben. <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>
<p>aber trotzdem danke. ich hab mich von dem satz verwirren lassen:</p>
<blockquote>
<p>This parameter can be a combination of the following values. ... INTERNET_FLAG_ASYNC ... INTERNET_FLAG_FROM_CACHE ... INTERNET_FLAG_OFFLINE</p>
</blockquote>
<p>und wil ich keine ge-cachten inhalte haben wollte, hab ich halt das erste genommen... *oops* <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
jetzt hab ich dwFlags auf NULL gestzt und es geht.</p>
<p>king, du hasts immer noch drauf. danke! danke! danke! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>lw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/474860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474860</guid><dc:creator><![CDATA[Lawilog]]></dc:creator><pubDate>Sun, 07 Mar 2004 10:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to WinInet &#x2F; HttpSendRequest on Sun, 07 Mar 2004 10:23:28 GMT]]></title><description><![CDATA[<p>Lawilog schrieb:</p>
<blockquote>
<p>hab ich doch geschrieben.</p>
</blockquote>
<p>Das hast Du auch. Ich habe nur Dein zweites Posting gelesen und mir dann den Code im Ersten angesehen. Soweit runter habe ich dann gar nicht mehr geschaut.<br />
Ich hoffe, Du lässt das als Ausrede gelten. <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>
<p>Lawilog schrieb:</p>
<blockquote>
<p>jetzt hab ich dwFlags auf NULL gestzt und es geht.</p>
</blockquote>
<p>Du meinst sicher 0 und nicht NULL, dwFlags ist kein Pointer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/474867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474867</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Sun, 07 Mar 2004 10:23:28 GMT</pubDate></item><item><title><![CDATA[Reply to WinInet &#x2F; HttpSendRequest on Sun, 07 Mar 2004 10:43:05 GMT]]></title><description><![CDATA[<blockquote>
<p>Ich hoffe, Du lässt das als Ausrede gelten.</p>
</blockquote>
<p>klar. <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>
<blockquote>
<p>Du meinst sicher 0 und nicht NULL, dwFlags ist kein Pointer.</p>
</blockquote>
<p>ich dachte immer:</p>
<pre><code class="language-cpp">#ifdef __cplusplus 
#define NULL 0
</code></pre>
<p>aber das soll keine grundsatzdiskusion werden und dir zu liebe werde ich natürlich 0 schreiben.</p>
<p>lw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/474882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474882</guid><dc:creator><![CDATA[Lawilog]]></dc:creator><pubDate>Sun, 07 Mar 2004 10:43:05 GMT</pubDate></item></channel></rss>