Alaska Software Inc. - Detect availeble serial port above COM10 - Comtest.prg
Username: Password:
AuthorTopic: Detect availeble serial port above COM10 - Comtest.prg
Jack DuijfDetect availeble serial port above COM10 - Comtest.prg
on Thu, 28 May 2020 18:16:08 +0200
Hello,

In windows 10, i try to detect the availeble serial COM devices.
This works fine for COM1 to COM9.
However, if a COM10 port is installed, i seem to be unable to detect this if the port is in use.

Try this test program as attache to this message, if a COM device is visible in the system properties.

Who can help me detecting a COM device above COM9, even if it is in use?
Regards
Jack Duijf

-------------------------------------------------------------
Also a member off the XXP (http://www.xxp.nl)


Comtest.prg
Frans VermeulenRe: Detect availeble serial port above COM10 - Comtest.prg
on Fri, 05 Jun 2020 14:23:16 +0200
Hi Jack,

I found PDR 5793.

Solution:

IF nPort > 9
  cDevice := "\\.\COM" + STR( nPort,2)
ELSE
  cDevice := "COM" + STR( nPort,1)
ENDIF

I suspect, your problem is related.

Regards,
Frans Vermeulen


> Hello,
> 
> In windows 10, i try to detect the availeble serial COM devices.
> This works fine for COM1 to COM9.
> However, if a COM10 port is installed, i seem to be unable to detect this if the port is in use.
> 
> Try this test program as attache to this message, if a COM device is visible in the system properties.
> 
> Who can help me detecting a COM device above COM9, even if it is in use?
> Regards
> Jack Duijf
> 
> -------------------------------------------------------------
> Also a member off the XXP (http://www.xxp.nl)


Frans Vermeulen <fv@gbor.nl>
Frans VermeulenRe: Detect availeble serial port above COM10 - Comtest.prg
on Fri, 05 Jun 2020 15:13:35 +0200
To add to that: here is the m$ doc that describes it.
https://docs.microsoft.com/nl-nl/windows/win32/fileio/naming-a-file#win32-file-namespaces

Regards,
Frans Vermeulen

> Hi Jack,
> 
> I found PDR 5793.
> 
> Solution:
> 
> IF nPort > 9
>   cDevice := "\\.\COM" + STR( nPort,2)
> ELSE
>   cDevice := "COM" + STR( nPort,1)
> ENDIF
> 
> I suspect, your problem is related.
> 
> Regards,
> Frans Vermeulen
> 
> 
> > Hello,
> > 
> > In windows 10, i try to detect the availeble serial COM devices.
> > This works fine for COM1 to COM9.
> > However, if a COM10 port is installed, i seem to be unable to detect this if the port is in use.
> > 
> > Try this test program as attache to this message, if a COM device is visible in the system properties.
> > 
> > Who can help me detecting a COM device above COM9, even if it is in use?
> > Regards
> > Jack Duijf
> > 
> > -------------------------------------------------------------
> > Also a member off the XXP (http://www.xxp.nl)
> 
> 
> -- 
> Frans Vermeulen <fv@gbor.nl>


Frans Vermeulen <fv@gbor.nl>