<?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[von USB empfangen]]></title><description><![CDATA[<p>wie kann ich von USB empfangen??</p>
<p>ich hab schon eine Verbindung aber wie geht des dann weiter??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/72250/von-usb-empfangen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 21:59:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/72250.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Apr 2004 18:41:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 18:41:50 GMT]]></title><description><![CDATA[<p>wie kann ich von USB empfangen??</p>
<p>ich hab schon eine Verbindung aber wie geht des dann weiter??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/509401</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509401</guid><dc:creator><![CDATA[Heinzelmännle]]></dc:creator><pubDate>Mon, 26 Apr 2004 18:41:50 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 18:52:14 GMT]]></title><description><![CDATA[<p><a href="http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/readfile.asp?frame=true" rel="nofollow">ReadFile</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/509403</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509403</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Mon, 26 Apr 2004 18:52:14 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 19:42:27 GMT]]></title><description><![CDATA[<p>irgentwie geht des nich GetLastError() gibt 87 zurück hier mal der code</p>
<pre><code class="language-cpp">HDC hdc=GetDC(NULL);

           char buf[200];
           char getstring[800];
           unsigned long  BytesWritten, BytesRead;    

           hTreiber = CreateFile(&quot;\\\\.\\USB#ROOT_HUB#4&amp;36ce346&amp;0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}&quot;,//&quot;\\\\.\\ HID#Vid_046d&amp;Pid_c025#6&amp;2fd80901&amp;0&amp;0000#{4d1e55b2-f16f-11cf-88cb-001111000030}&quot;,&quot;\\\\.\\USB#ROOT_HUB#4&amp;36ce346&amp;0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}&quot;, // Treiber wird geladen 0
                   GENERIC_READ,
                   0, 
                   NULL,
                   OPEN_EXISTING, 
                   FILE_FLAG_OVERLAPPED ,
                   NULL); 

           if (hTreiber == INVALID_HANDLE_VALUE) 
           { 
                 MessageBox(NULL,&quot;Verbindung zum USB-Port konnte nicht hergestellt werden!&quot;,0,0); 
                 CloseHandle(hTreiber); 
                 return 0; 
           }else  
           {
               MessageBox(NULL,&quot;Verbindung zum USB-Port akzeptiert!&quot;,0,0); 
           } 

            sprintf(buf,&quot;GetLastError=%d&quot;,GetLastError());
            TextOut(hdc,0,0,buf,strlen(buf));  

             ReadFile(hTreiber, 
                 getstring, 
                 sizeof(getstring), 
                 &amp;BytesRead, 
                 NULL); 

             sprintf(buf,&quot;GetLastError=%d &quot;,GetLastError());
             TextOut(hdc,0,20,buf,strlen(buf));  
             sprintf(buf,&quot;empfangen=%d bytes=%d&quot;,getstring,BytesRead);
             TextOut(hdc,0,40,buf,strlen(buf));
             DeleteDC(hdc);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/509433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509433</guid><dc:creator><![CDATA[Heinzelmännle]]></dc:creator><pubDate>Mon, 26 Apr 2004 19:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 19:46:26 GMT]]></title><description><![CDATA[<p>Und an welcher Stelle genau (du rufst ja mehrere Male GetLastError auf) kommt das jetzt?</p>
<blockquote>
<p>87 - The parameter is incorrect. - ERROR_INVALID_PARAMETER</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/509436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509436</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 26 Apr 2004 19:46:26 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 19:53:42 GMT]]></title><description><![CDATA[<p>Aus der Hilfe zu ReadFile:</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>If hFile was opened with FILE_FLAG_OVERLAPPED, the lpOverlapped parameter must not be NULL. It must point to a valid OVERLAPPED structure.</p>
</blockquote>
<p>So, und dann willst Du 800 Bytes vom Root Hub lesen. Kannst Du mir erklären, was Du vom Root Hub für Daten erwartest? Was sollen Deiner Meinung nach in den 800 Bytes an Daten landen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/509443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509443</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Mon, 26 Apr 2004 19:53:42 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 20:01:24 GMT]]></title><description><![CDATA[<p>also ich hab da die maus angeschlossen und denke das daran jetzt die positon der maus drin is</p>
]]></description><link>https://www.c-plusplus.net/forum/post/509448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509448</guid><dc:creator><![CDATA[Heinzelmännle]]></dc:creator><pubDate>Mon, 26 Apr 2004 20:01:24 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 20:05:42 GMT]]></title><description><![CDATA[<p>lol</p>
]]></description><link>https://www.c-plusplus.net/forum/post/509453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509453</guid><dc:creator><![CDATA[:o)]]></dc:creator><pubDate>Mon, 26 Apr 2004 20:05:42 GMT</pubDate></item><item><title><![CDATA[Reply to von USB empfangen on Mon, 26 Apr 2004 20:14:14 GMT]]></title><description><![CDATA[<p>Heinzelmännle schrieb:</p>
<blockquote>
<p>also ich hab da die maus angeschlossen und denke das daran jetzt die positon der maus drin is</p>
</blockquote>
<p>Du sprichst aber nicht mit der Maus, Du sprichst mit dem Root Hub. Du mußt Dir ein Handle auf die Maus besorgen.</p>
<p>Dazu solltest Du den Pfad zum Gerät nicht direkt angeben, sondern zur Laufzeit ermitteln. Das geht mit dem Setup-API (im Notfall: Suchfunktion). Die Maus ist ein HID, und danach mußt Du suchen. Anhand VID und PID kannst Du das Gerät indentifizieren (<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intinput/hh/intinput/hidfunc_3ewi.asp?frame=true" rel="nofollow">HidD_GetAttributes</a>).</p>
<p>Danach darfst Du nicht einfach 800 Bytes einlesen, sondern mußt die Länge des Input-Reports exakt angeben, dazu den Identifier des Reports. Abfragen kannst Du das mit <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intinput/hh/intinput/hidfunc_7rg2.asp?frame=true" rel="nofollow">HidD_GetPreparsedData</a>, <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intinput/hh/intinput/hidfunc_3qr6.asp?frame=true" rel="nofollow">HidP_GetCaps</a> und <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intinput/hh/intinput/hidfunc_9sqa.asp?frame=true" rel="nofollow">HidD_FreePreparsedData</a>.</p>
<p>Du bekommst von der Maus aber garantiert <strong>keinen</strong> String geliefert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/509462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/509462</guid><dc:creator><![CDATA[-King-]]></dc:creator><pubDate>Mon, 26 Apr 2004 20:14:14 GMT</pubDate></item></channel></rss>