<?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[Problem bei file Download]]></title><description><![CDATA[<p>Hab mit hilfe von InternetOpenUrl ein download programm geschrieben das aber nach ein paar bits hängen bleibt und erst nach vollständigen download wieder reagiert das ist aber nur beim ersten start der fall, beim zweiten mal läuft es problemlos wie kann ich das ändern, ich weis das die files beim zweiten durchlauf bereits im speicher sind und beim ersten mal geladen wurden .</p>
<p>hat einer ne idee <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> thx im voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174604/problem-bei-file-download</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 13:23:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174604.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Mar 2007 02:37:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem bei file Download on Thu, 01 Mar 2007 02:37:53 GMT]]></title><description><![CDATA[<p>Hab mit hilfe von InternetOpenUrl ein download programm geschrieben das aber nach ein paar bits hängen bleibt und erst nach vollständigen download wieder reagiert das ist aber nur beim ersten start der fall, beim zweiten mal läuft es problemlos wie kann ich das ändern, ich weis das die files beim zweiten durchlauf bereits im speicher sind und beim ersten mal geladen wurden .</p>
<p>hat einer ne idee <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> thx im voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237188</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Thu, 01 Mar 2007 02:37:53 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Thu, 01 Mar 2007 23:45:04 GMT]]></title><description><![CDATA[<p>kann wirklich keiner helfen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237803</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Thu, 01 Mar 2007 23:45:04 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Fri, 02 Mar 2007 14:53:20 GMT]]></title><description><![CDATA[<p>Korrigiert mich wenn ich falsch liege, aber bei diesen Netwerk funktionen denke ich immer an Blocking Calls.</p>
<p>Versuchs evtl. mal mit nem eigene Thread.</p>
<p>MFG<br />
Ace</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238148</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238148</guid><dc:creator><![CDATA[AceKiller73]]></dc:creator><pubDate>Fri, 02 Mar 2007 14:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Fri, 02 Mar 2007 17:16:18 GMT]]></title><description><![CDATA[<p>hab bis etz noch net mit threads gearbeitet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238231</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Fri, 02 Mar 2007 17:16:18 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 01:18:43 GMT]]></title><description><![CDATA[<p>AceKiller73 hat Recht, da wirste um nen Thread wohl nicht herum kommen.</p>
<p>In der FAQ oder Forensuche findet man zu Thread bestimmt was...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238752</guid><dc:creator><![CDATA[geeky (nicht eingeloggt)]]></dc:creator><pubDate>Sun, 04 Mar 2007 01:18:43 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 01:36:54 GMT]]></title><description><![CDATA[<p>konnte ich mir schon denken hab auch schon nach Threads gesucht nur bin ich noch nicht ganz da hinter gestiegen</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238757</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 01:36:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 13:37:11 GMT]]></title><description><![CDATA[<p>Und Wie Packe ich jetzt meine funktion in einen thread</p>
<p>bsp.: so rufe ich InternetOpenUrl auf</p>
<pre><code class="language-cpp">[code]
BOOL GetFile (HWND hwndProgress,HWND hwndStaticText,HINTERNET IN hOpen, CHAR *szUrl, CHAR *szFileName)
   {
       DWORD dwSize;
       CHAR   szHead[] = &quot;Accept: */*\r\n\r\n&quot;;
       VOID * szTemp[16384];
       HINTERNET  hConnect;
       FILE * pFile;

       if ( !(hConnect = InternetOpenUrl ( hOpen, szUrl, szHead, lstrlen (szHead), INTERNET_FLAG_DONT_CACHE, 0)))
       {
		   MessageBox(hWWnd,&quot;Error ! : URL Fehler&quot;,&quot;Error&quot;,0);
           return 0;
       }

       if  ( !(pFile = fopen (szFileName, &quot;wb&quot; ) ) )
       {
		  MessageBox(hWWnd,&quot;Error ! 2&quot;,&quot;Error&quot;,0);
          return FALSE;
       }
	   DWORD dwByteToRead = 0;
	   DWORD dwSizeOfRq = 4;
	   DWORD dwBytes = 0;

	   if (!HttpQueryInfo(hConnect, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, (LPVOID)&amp;dwByteToRead, &amp;dwSizeOfRq, NULL))
	   {
			dwByteToRead = 0;
	   }

	   DWORD start;
	   DWORD end;
	   DWORD time;
	   time = 10;
	   start = timeGetTime();

       do
       {
          if (!InternetReadFile (hConnect, szTemp, 16384,  &amp;dwSize) )
          {
              fclose (pFile);
			  MessageBox(hWWnd,&quot;Error ! 3&quot;,&quot;Error&quot;,0);
            return FALSE;
          }
          if (!dwSize)
              break;  // Condition of dwSize=0 indicate EOF. Stop.
          else
             fwrite(szTemp, sizeof (char), dwSize , pFile);
			 dwBytes+=dwSize;
			 if(dwByteToRead &amp;&amp; hwndProgress)
			 {
				SendMessage(hwndProgress, PBM_SETPOS,(dwBytes*100)/dwByteToRead,0);
				UpdateWindow(hwndProgress);
			 }
			 FLOAT fSpeed = 0;
			 fSpeed = (float)dwBytes;
			 fSpeed /= ((float)time)/1000.0f;
			 fSpeed /= 1024.0f;
			 if(hwndProgress)
			 {
				char s[260];
				sprintf(s, &quot;%d KB / %d KB @ %1.1f KB/s&quot;, dwBytes/1024, dwByteToRead/1024, fSpeed);
				SetWindowText(hwndStaticText, s);
				UpdateWindow(hwndStaticText);
			 }
			 end = timeGetTime();
			 time = end - start;
			 if(time == 0)
			 time = 10;
       }   // do
      while (TRUE);
      fflush (pFile);
      fclose (pFile);
      return TRUE;
   }

int InternetDownloadFile(HWND hwndProgress,HWND hwndStaticText, char *URL, char *FileDest)
{
	DWORD dwFlags;
	DWORD dwResult = INTERNET_ERROR_OPEN;

	InternetGetConnectedState(&amp;dwFlags, 0);

	if(dwFlags &amp; INTERNET_CONNECTION_OFFLINE)//take appropriate steps
	return INTERNET_ERROR_OPEN;

	char strAgent[64];

	sprintf(strAgent, &quot;Agent%ld&quot;, timeGetTime());

	HINTERNET hOpen;

	if(!(dwFlags &amp; INTERNET_CONNECTION_PROXY))
		hOpen = InternetOpenA(strAgent, INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY, NULL, NULL, 0);
	else
		hOpen = InternetOpenA(strAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
	if(hOpen)
	{
		dwResult = GetFile (hwndProgress,hwndStaticText,hOpen, URL, FileDest);
		InternetCloseHandle(hOpen);
	}
    else return INTERNET_ERROR_OPEN;
	return dwResult;
}
[/code]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1238943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238943</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 13:37:11 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 13:54:24 GMT]]></title><description><![CDATA[<p>Threads in der WinApi:<br />
<a href="http://msdn2.microsoft.com/en-us/library/ms682453.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms682453.aspx</a></p>
<pre><code class="language-cpp">HANDLE WINAPI CreateThread(
  LPSECURITY_ATTRIBUTES lpThreadAttributes,
  SIZE_T dwStackSize,
  LPTHREAD_START_ROUTINE lpStartAddress,
  LPVOID lpParameter,
  DWORD dwCreationFlags,
  LPDWORD lpThreadId
);
</code></pre>
<p>Wichtig ist dort LPTHREAD_START_ROUTINE lpStartAddress. Das ist ein Pointer auf eine ThreadProc funktion. Wie diese auszusehen hat kannste hier nachlesen:<br />
<a href="http://msdn2.microsoft.com/en-us/library/ms686736.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms686736.aspx</a></p>
<p>Alles was dann in der ThreadProc gemacht wird, wird in einem seperaten Thread ausgeführt</p>
<p>Wenn du den BCB benutzt gibts da glaub ich auch noch BeginThreadEx.Da kenn ich mich aber net so gut aus.</p>
<p>MFG<br />
Ace</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238955</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238955</guid><dc:creator><![CDATA[AceKiller73]]></dc:creator><pubDate>Sun, 04 Mar 2007 13:54:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 13:58:32 GMT]]></title><description><![CDATA[<p>Ne Benutze Visual Studio 2005</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238959</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 13:58:32 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 13:59:49 GMT]]></title><description><![CDATA[<p>Prinzipiell brauchst du ne ThreadProc(), in der du quasi deine fertige GetFile() Funktion aufrufen könntest. Parameter kannst du an die ThreadProc() über den lpParam übergeben (z.B. über nen Pointer auf ne Struktur)</p>
<p>Den Thread selbst erzeugst du mittels CreateThread() wo du dann die ThreadProc angibst.</p>
<p>Aufpassen muss du allerdings ein wenig mit Variablen-Zugriffen. Wenn du innerhalb des Threads z.B. auf globale Variablen zugreifen willst musst du das syncronisieren (da gibt es z.B. CreateCriticalSection() ...), sonst könnte es crashen <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=";D"
      alt="😉"
    /></p>
<p>Auch aufpassen musst du bei SetWindowText() und solchen GUI-Funktionen. Die Controls mögen es nämlich leider nicht so gerne was von nem Fremd-Thread zu bekommen. Nen Status-Text könnte man z.B. in ne syncronisierte Variable schreiben und an das Fenster dann via PostMessage() ne benutzer-definierte Nachricht schicken, die dann die eigentliche Arbeit macht <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=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238961</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 04 Mar 2007 13:59:49 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 14:12:27 GMT]]></title><description><![CDATA[<p>aja schnall ich zwar noch net ganz werds aber mal probieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238971</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 14:12:27 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 19:03:05 GMT]]></title><description><![CDATA[<p>hab mal ne frage muss ich für ThreadProc einen struct erzeugen</p>
<p>wie das bsp. von msdn</p>
<pre><code>typedef struct _MyData {
    int val1;
    int val2;
} MYDATA, *PMYDATA;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1239162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239162</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 19:03:05 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 19:24:53 GMT]]></title><description><![CDATA[<p>generell ist es dafür gedacht Informationen mit in den Thread zu geben.<br />
Nen struct macht bei dir wohl Sinn, da könntest du direkt die Handles, die zu downloadene Datei etc. reinpacken...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239170</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 04 Mar 2007 19:24:53 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 19:35:57 GMT]]></title><description><![CDATA[<p>ok dann werd ichs mal probieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239175</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239175</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 19:35:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Sun, 04 Mar 2007 22:14:46 GMT]]></title><description><![CDATA[<p>Kennt noch einer n Gutes Tutorial für threads</p>
<p>thx <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239262</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 04 Mar 2007 22:14:46 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Mon, 05 Mar 2007 00:36:28 GMT]]></title><description><![CDATA[<p>Bei codeproject findet sich da was:<br />
<a href="http://www.codeproject.com/threads/#Threads" rel="nofollow">http://www.codeproject.com/threads/#Threads</a></p>
<p>Pseudo-Code:</p>
<pre><code class="language-cpp">typedef struct _MyDownloadData {
    HWND hwndProgress;
    HWND hwndStaticText;
    HINTERNET hOpen;
    CHAR *szUrl;
    CHAR *szFileName;    
} MyDownloadData, *PMyDownloadData;

DWORD WINAPI MyDownloadThread(LPVOID lpParameter)
{
    PMyDownloadData myData=(PMyDownloadData)lpParameter;

    // Deine GetFile aufrufen:
   GetFile (myData-&gt;hwndProgress,myData-&gt;hwndStaticText,myData-&gt;hOpen,myData-&gt;szUrl, myData-&gt;szFileName);

   // Thread hat fertig:
   ExitThread(0);
}

// Irgendwo deinen Thread starten:

DWORD dwThreadId; // Thread-ID

MyDownloadData threadData;

threadData.hwndProgress=...;
threadData.hwndStaticText=...;
threadData.hOpen=...;
threadData.szUrl=&quot;http://www.bluppdidupp.de&quot;;
threadData.szFileName=&quot;c:\\test.html&quot;;    

HANDLE hThread = CreateThread( 
            NULL,              // default security attributes
            0,                 // use default stack size  
            MyDownloadThread,        // thread function 
            &amp;threadData,             // argument to thread function 
            0,                 // use default creation flags 
            &amp;dwThreadId);   // returns the thread identifier 

        // Check the return value for success. 

        if (hThread == NULL) 
        {
            OutputDebugString(&quot;fehler! meeeeeep!!&quot;);
        }    
        else
        {
            OutputDebugString(&quot;Thread rennt!&quot;);
        }
</code></pre>
<p>Problem wird allerdings z.B. SendMessage(), SetWindowText() und UpdateWindow() im Thread sein!<br />
GUI-Elemente niemals versuchen von nem Fremdthread anzusprechen!<br />
Aber die Dinger kannste ja zu Testzwecken erstmal auskommentieren und im zweiten Step mal an Thread-Syncronisation gehen <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=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239287</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Mon, 05 Mar 2007 00:36:28 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Mon, 05 Mar 2007 08:55:14 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/41">@geeky</a> bist der beste <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> werds heut gleich mal probieren kann aber spät werden hab heut zweite schicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239348</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Mon, 05 Mar 2007 08:55:14 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Tue, 06 Mar 2007 00:27:45 GMT]]></title><description><![CDATA[<p>also dieser thread den du gepostet hast funktioniert musste aber wie du schon sagtest einiges auskomentieren</p>
<p>bsp.:</p>
<pre><code>//threadData.hwndProgress=...;
//threadData.hwndStaticText=...;
threadData.hOpen=hOpen; 
threadData.szUrl=buffer_a; 
threadData.szFileName=buffer_b;
</code></pre>
<p>aber mal ne frage wie finde ich heraus das der thread beendet ist</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239963</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239963</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Tue, 06 Mar 2007 00:27:45 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Tue, 06 Mar 2007 00:39:19 GMT]]></title><description><![CDATA[<p>habs schon Denke ich !<br />
mit</p>
<p>WaitForSingleObject(hThread, INFINITE);<br />
CloseHandle(hThread);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239964</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Tue, 06 Mar 2007 00:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Tue, 06 Mar 2007 10:44:28 GMT]]></title><description><![CDATA[<p>Wie Syncronisiere ich jetzt den thread mein programm hängt sich auf oder bracuht ewig</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1240130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1240130</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Tue, 06 Mar 2007 10:44:28 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Wed, 07 Mar 2007 16:43:50 GMT]]></title><description><![CDATA[<p>Das is ne gute Frage <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=";D"
      alt="😉"
    /> (/me kennt sich mit Threads in WinAPI quasi eigentlich gar nicht aus ;D)</p>
<p>Aufhängen? hmm. ungewollte Endlosschleife oder blockierende Funktion im Thread? Evtl. ein wenig mit OutputDebugString() und/oder Debugger rumspielen?</p>
<p>WaitForSingleObject() macht außer beim Programmende mit INFINITE nicht viel Sinn oder? WaitForSingleObject() blockiert dann doch auch, oder nich? hmm...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1241117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1241117</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Wed, 07 Mar 2007 16:43:50 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Wed, 07 Mar 2007 22:55:22 GMT]]></title><description><![CDATA[<p>dafür haste mich aber ziemlich weit gebracht muss dafür aber unbedingt nochmal danke sagen ohne dich bin ich echt aufgeschmissen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1241334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1241334</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Wed, 07 Mar 2007 22:55:22 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Thu, 08 Mar 2007 15:38:17 GMT]]></title><description><![CDATA[<p>hab den hinweis bekommen das ich diese while schleife (bsp) in der Do While Schleife einfügen soll</p>
<pre><code>MSG msg;
while( PeekMessage(&amp;msg, NULL, 0, 0, PM_NOREMOVE ) )
{       
   if( GetMessage(&amp;msg, NULL, 0, 0))     
  {      
    TranslateMessage(&amp;msg);      
    DispatchMessage(&amp;msg);   
  } 
  else 
  {        	 	
     break;    
  }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1241736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1241736</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Thu, 08 Mar 2007 15:38:17 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Thu, 08 Mar 2007 18:39:57 GMT]]></title><description><![CDATA[<p>Das sieht für mich ziemlich beknackt aus <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=";D"
      alt="😉"
    /></p>
<p>Die Standard MessageLoop sieht so aus:</p>
<pre><code class="language-cpp">while (GetMessage(&amp;msg, NULL, 0, 0)) // Hier wird quasi die Nachricht abgeholt oder gewartet bis eine da ist ;D
{      
    TranslateMessage(&amp;msg);      // Hier noch ein wenig verarbeitet
    DispatchMessage(&amp;msg);       // Hier kommt die WndProc zum Zuge
}
</code></pre>
<p>PeekMessage() sollte man möglichst vermeiden (da non-blocking und somit CPU-Zeit raubend)<br />
GetMessage() ist quasi dasselbe nur wartet es bis ne neue Message da ist.<br />
Wenn das Programm beendet wird liefert GetMessage() false!<br />
GetMessage und PeekMessage in der Form macht irgendwie gar keinen Sinn, oder?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1241864</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1241864</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Thu, 08 Mar 2007 18:39:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem bei file Download on Thu, 08 Mar 2007 18:44:16 GMT]]></title><description><![CDATA[<p>das hab ich mir auch gedacht aber mein programm ladet konstant ohne zu blockieren, aber ich bastl trotzdem noch an der thread version</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1241866</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1241866</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Thu, 08 Mar 2007 18:44:16 GMT</pubDate></item></channel></rss>