Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6: Checking for Comm ports
Message
From
07/02/2002 14:09:15
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00616859
Message ID:
00616878
Views:
13
You can try the following:
LOCAL oComm, i, cOldErrorHandler
DECLARE aComPorts[16]
aComPorts = .T.
cOldErrorHandler = ON('ERROR')
FOR i = 1 TO 16
  Wait WINDOW "checking Port "+ALLTRIM(STR(i)) NOWAIT
  oComm = CREATEOBJ('MsCOMMLib.Mscomm')
  oComm.CommPort = i
  ON ERROR aComPorts[i] = .F.
  oComm.PortOpen = .T.
  ? oComm.CommPort
  ?? oComm.PortOpen
  oComm.PortOpen = .F.
  oComm = NULL
  ON ERROR &cOldErrorHandler
ENDFOR
?
?
?
WAIT WINDOW "Finished!" NOWAIT
>How can I find out what comm ports are on a PC? I have a PC that doesn't have comm port 2 defined even though there is one on the PC. Any ideas?
>TIA!
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform