Lazarus

Programming => General => Topic started by: majid.ebru on February 15, 2022, 10:14:02 am

Title: Count of port Com ??
Post by: majid.ebru on February 15, 2022, 10:14:02 am
Hi
i use comport.
my laptop does not has any port com(Serial port) , when i use comport , my program stoped. :o

how can i get count of port ?
how can i check that my laptop(or other devices) has port com or does not?

best regard
Title: Re: Count of port Com ??
Post by: Zvoni on February 15, 2022, 10:53:03 am
Use Synaser?
Title: Re: Count of port Com ??
Post by: ccrause on February 15, 2022, 11:22:19 am
Use Synaser?
Link: https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/synaser.pas#l2392
Title: Re: Count of port Com ??
Post by: majid.ebru on February 15, 2022, 12:58:06 pm
No I should use tcomport
http://comport.sf.net (http://comport.sf.net)
Title: Re: Count of port Com ??
Post by: Jurassic Pork on February 15, 2022, 02:33:28 pm
Hello,
No I should use tcomport
http://comport.sf.net (http://comport.sf.net)
Why TComport ?
TLazserial is based on TComport and synaser and it has a method to detect the serial ports ( see port settings in the  sertest demo project of Tlazserial)
Friendly, J.P
Title: Re: Count of port Com ??
Post by: majid.ebru on February 15, 2022, 04:11:21 pm
Thank you
But I want to use Tcomport.
Title: Re: Count of port Com ??
Post by: majid.ebru on October 02, 2022, 01:16:06 pm
Hi
i found answer :
(Windows )

https://forum.lazarus.freepascal.org/index.php?topic=35667.msg236210#msg236210 (https://forum.lazarus.freepascal.org/index.php?topic=35667.msg236210#msg236210)

Title: Re: Count of port Com ??
Post by: alpine on October 02, 2022, 01:52:47 pm
No I should use tcomport
http://comport.sf.net (http://comport.sf.net)
There is a procedure into the CPort.pas doing exactly that:
Code: Pascal  [Select][+][-]
  1. procedure EnumComPorts(Ports: TStrings);
Title: Re: Count of port Com ??
Post by: superc on October 03, 2022, 09:29:06 am
Hi
i use comport.
my laptop does not has any port com(Serial port) , when i use comport , my program stoped. :o

how can i get count of port ?
how can i check that my laptop(or other devices) has port com or does not?

best regard

In case you work only under Windows an opportunity could be to use the windows registry, as in the thread here:

https://stackoverflow.com/questions/4999964/serial-port-enumeration-in-delphi-using-setupdigetclassdevs


TinyPortal © 2005-2018