🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #542

Re: serial com port

#542
From: Igor cardoso
Date: Fri, 11 Jan 2008 17:46
24 lines
2197 bytes
Sorry for the delay dude, i saw your post because i was searching for
the same thing. Thats one of the ways i learned:

TStringList* availableComPorts = new TStringList();
      TRegistry *Registry = new TRegistry(KEY_READ);
      AnsiString portNb ="";

      Registry->RootKey = HKEY_LOCAL_MACHINE;
      // The com ports are administered in the following directory.
      // false, because no entry is supposed to be created.
      Registry->OpenKey("HARDWARE\\DEVICEMAP\\SERIALCOMM", false);

      // Extract the COM port names and store them.
      Registry->GetValueNames(availableComPorts);
      // List the available COM ports in the corresponding combo box.
      for (int i(0); i < availableComPorts->Count; i++)
      {
          portNb = Registry->ReadString(availableComPorts-
>Strings[i]);
          ComboBox1->AddItem(portNb, NULL);
      }
      delete Registry;
      delete availableComPorts;
Technical Details
Message-ID: <a04ff3ad-94eb-4107-9e0c-29278f30a692@u10g2000prn.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!postnews.google.com!u10g2000prn.googlegroups.com!not-for-mail
References: <4766f9fb$1@newsgroups.borland.com> <47674188$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f449972765dec112
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!postnews.google.com!u10g2000prn.googlegroups.com!not-for-mail
From: Igor cardoso <igorfcardoso@gmail.com>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: serial com port
Date: Fri, 11 Jan 2008 09:46:08 -0800 (PST)
Organization: http://groups.google.com
Lines: 27
Message-ID: <a04ff3ad-94eb-4107-9e0c-29278f30a692@u10g2000prn.googlegroups.com>
References: <4766f9fb$1@newsgroups.borland.com> <47674188$1@newsgroups.borland.com>
NNTP-Posting-Host: 201.67.78.5
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1200073569 3949 127.0.0.1 (11 Jan 2008 17:46:09 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 11 Jan 2008 17:46:09 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u10g2000prn.googlegroups.com; posting-host=201.67.78.5; 
 posting-account=muBNUQoAAAA8hTX5j0mP8q4SxwevxEch
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.11) 
 Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)