<?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[Mal wieder serielle Schnittstelle... :(]]></title><description><![CDATA[<p>Hi Leute...<br />
Warum klappt folgender Code nicht?</p>
<pre><code class="language-cpp">int main( int argc, char* argv[] )
{
	HANDLE hCom;
	hCom = CreateFile(	&quot;COM1&quot;,
						GENERIC_READ,
						0,
						NULL,
						OPEN_EXISTING,
						FILE_ATTRIBUTE_NORMAL,
						NULL	);

	if( hCom == INVALID_HANDLE_VALUE )
	{
		return 0;
	}

	DWORD dwRead;

	char lpBuf[12];

	// Issue read operation.
	ReadFile( hCom, lpBuf, 1, &amp;dwRead, NULL );
	cout &lt;&lt; dwRead;

	CloseHandle( hCom );

	return 0;
}
</code></pre>
<p>Er bleibt bei ReadFile immer haengen... <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 />
Ich habe mir den Code einfach mal aus einer Menge Suchergebnissen zusammengesetzt... Nur funktioniert das nicht...<br />
Wer kann mir helfen?<br />
Erstmal will ich nur, dass er wenigstens das ReadFile schafft.. Was er liest oder wie oder wo oder.. ist mir egal.. Er soll er erstmal irgendwas lesen...<br />
Sorry, dass ich dieses Thema jetzt zum 1000. Mal anspreche, aber ich komme einfach nicht drauf und habe davon auch nicht wirklich Ahnung, also entschuldigt mein spaerliches Wissen bitte.. <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="😃"
    /><br />
Danke.<br />
MfG Aoeke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/84705/mal-wieder-serielle-schnittstelle</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 20:04:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/84705.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Sep 2004 17:58:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mal wieder serielle Schnittstelle... :( on Wed, 01 Sep 2004 17:58:56 GMT]]></title><description><![CDATA[<p>Hi Leute...<br />
Warum klappt folgender Code nicht?</p>
<pre><code class="language-cpp">int main( int argc, char* argv[] )
{
	HANDLE hCom;
	hCom = CreateFile(	&quot;COM1&quot;,
						GENERIC_READ,
						0,
						NULL,
						OPEN_EXISTING,
						FILE_ATTRIBUTE_NORMAL,
						NULL	);

	if( hCom == INVALID_HANDLE_VALUE )
	{
		return 0;
	}

	DWORD dwRead;

	char lpBuf[12];

	// Issue read operation.
	ReadFile( hCom, lpBuf, 1, &amp;dwRead, NULL );
	cout &lt;&lt; dwRead;

	CloseHandle( hCom );

	return 0;
}
</code></pre>
<p>Er bleibt bei ReadFile immer haengen... <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 />
Ich habe mir den Code einfach mal aus einer Menge Suchergebnissen zusammengesetzt... Nur funktioniert das nicht...<br />
Wer kann mir helfen?<br />
Erstmal will ich nur, dass er wenigstens das ReadFile schafft.. Was er liest oder wie oder wo oder.. ist mir egal.. Er soll er erstmal irgendwas lesen...<br />
Sorry, dass ich dieses Thema jetzt zum 1000. Mal anspreche, aber ich komme einfach nicht drauf und habe davon auch nicht wirklich Ahnung, also entschuldigt mein spaerliches Wissen bitte.. <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="😃"
    /><br />
Danke.<br />
MfG Aoeke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/597206</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597206</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 01 Sep 2004 17:58:56 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder serielle Schnittstelle... :( on Wed, 01 Sep 2004 18:17:13 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>was meinst du mit &quot;er bleibt bei ReadFile haengen&quot; ......<br />
Wurden überhaupt Daten an die Schnittstelle gesendet, falls nicht kannst du ja auch keine Daten aus dem Puffer der Schnittstelle lesen !!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/597218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597218</guid><dc:creator><![CDATA[MarcC]]></dc:creator><pubDate>Wed, 01 Sep 2004 18:17:13 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder serielle Schnittstelle... :( on Wed, 01 Sep 2004 18:20:52 GMT]]></title><description><![CDATA[<p>^^ Da ist was dran... <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="🙄"
    /><br />
Danke fuer den Hinweis...<br />
MfG Aoeke <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>
]]></description><link>https://www.c-plusplus.net/forum/post/597220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597220</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 01 Sep 2004 18:20:52 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder serielle Schnittstelle... :( on Wed, 01 Sep 2004 18:33:30 GMT]]></title><description><![CDATA[<p>schau dir mal 'SetCommTimeouts()' an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/597238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597238</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Wed, 01 Sep 2004 18:33:30 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder serielle Schnittstelle... :( on Wed, 01 Sep 2004 18:43:53 GMT]]></title><description><![CDATA[<p>Schau dir auch mal folgende Seite beim MSDN an :</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/communications_resources.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/communications_resources.asp</a></p>
<p>Hier findest du Infos zur Programmierung und Konfiguration(!!WICHTIG!!) der Schnittstelle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/597249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597249</guid><dc:creator><![CDATA[MarcC]]></dc:creator><pubDate>Wed, 01 Sep 2004 18:43:53 GMT</pubDate></item><item><title><![CDATA[Reply to Mal wieder serielle Schnittstelle... :( on Wed, 01 Sep 2004 18:50:24 GMT]]></title><description><![CDATA[<p>Danke fuer den Link.<br />
Werde ich mir mal anschauen.<br />
MfG Aoeke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/597257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597257</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 01 Sep 2004 18:50:24 GMT</pubDate></item></channel></rss>