<?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[Liste von COM Ports]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich würde gern einmal wissen, wie ich an die derzeit im System installierten COM-Ports rankomme.<br />
Diese will ich dann dem Nutzer zur Auswahl geben.</p>
<p>Leider macht:</p>
<pre><code class="language-cpp">void GetSerialPortsList(LPSTR szSymbol);
</code></pre>
<p>nicht gerade das, was der Name vermuten lässt.</p>
<p>Ich hoffe ihr kennt eine Antwort.<br />
Aso wäre schön wenn das dann unter w2k/XP funktionieren würde.</p>
<p>mfg Saxony007</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147347/liste-von-com-ports</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 04:42:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147347.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 May 2006 07:39:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Liste von COM Ports on Tue, 16 May 2006 07:39:15 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich würde gern einmal wissen, wie ich an die derzeit im System installierten COM-Ports rankomme.<br />
Diese will ich dann dem Nutzer zur Auswahl geben.</p>
<p>Leider macht:</p>
<pre><code class="language-cpp">void GetSerialPortsList(LPSTR szSymbol);
</code></pre>
<p>nicht gerade das, was der Name vermuten lässt.</p>
<p>Ich hoffe ihr kennt eine Antwort.<br />
Aso wäre schön wenn das dann unter w2k/XP funktionieren würde.</p>
<p>mfg Saxony007</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058616</guid><dc:creator><![CDATA[Saxony007]]></dc:creator><pubDate>Tue, 16 May 2006 07:39:15 GMT</pubDate></item><item><title><![CDATA[Reply to Liste von COM Ports on Tue, 16 May 2006 08:44:59 GMT]]></title><description><![CDATA[<p><a href="http://www.naughter.com/enumser.html" rel="nofollow">http://www.naughter.com/enumser.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058642</guid><dc:creator><![CDATA[~~~~]]></dc:creator><pubDate>Tue, 16 May 2006 08:44:59 GMT</pubDate></item><item><title><![CDATA[Reply to Liste von COM Ports on Tue, 16 May 2006 09:01:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>vielen Dank. Hat mir geholfen.<br />
Anstatt wie ich es versucht habe mit:</p>
<pre><code class="language-cpp">BOOL GetDefaultCommConfig(

    LPCSTR lpszName,	
    LPCOMMCONFIG lpCC,	
    LPDWORD lpdwSize	
   );
</code></pre>
<p>Hab ich es nun mit:</p>
<pre><code class="language-cpp">HANDLE CreateFile(LPCTSTR lpszName, DWORD fdwAccess, DWORD fdwShareMode, LPSECURITY_ATTRIBUTES lpsa, DWORD fdwCreate, DWORD fdwAttrsAndFlags, HANDLE hTemplateFile)
</code></pre>
<p>gemacht.</p>
<p>Hier der Source für Interessierte:</p>
<pre><code class="language-cpp">COMMCONFIG comcfg;
    unsigned long sizecc = sizeof(COMMCONFIG);
    char szPort[15];
    for(int i = 0; i &lt; 256; i++) {

        // port format \\.\COMx
        wsprintf(szPort, &quot;\\\\.\\COM%d&quot;, i);

        HANDLE hPort = ::CreateFile(szPort, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
        if (hPort == INVALID_HANDLE_VALUE) {

            DWORD error = GetLastError();
            // port already open etc.            
            if (error== ERROR_ACCESS_DENIED || error== ERROR_GEN_FAILURE || error== ERROR_SHARING_VIOLATION) {

                TestReport-&gt;Lines-&gt;Append(szPort);
            }
        } else {

            TestReport-&gt;Lines-&gt;Append(szPort);
            CloseHandle(hPort);
        }
    }
</code></pre>
<p>mfg Saxony</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058660</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058660</guid><dc:creator><![CDATA[Saxony007]]></dc:creator><pubDate>Tue, 16 May 2006 09:01:56 GMT</pubDate></item><item><title><![CDATA[Reply to Liste von COM Ports on Tue, 16 May 2006 10:43:07 GMT]]></title><description><![CDATA[<p>Damit findest Du aber keine, die schon offen sind... Nauhgter hat deswegen min. drei Varianten...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058748</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 16 May 2006 10:43:07 GMT</pubDate></item><item><title><![CDATA[Reply to Liste von COM Ports on Tue, 16 May 2006 12:04:57 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>also mit der oben beschriebenen Variante bekomme ich auch schon offene Ports mit in die Ergebnismenge.<br />
Siehe Auswertung GetLastError() bei if (hPort == INVALID_HANDLE_VALUE) {...}</p>
<p>mfg Saxony</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1058822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1058822</guid><dc:creator><![CDATA[Saxony007]]></dc:creator><pubDate>Tue, 16 May 2006 12:04:57 GMT</pubDate></item></channel></rss>