|
-
Feb 2nd, 2001, 03:48 PM
#1
Thread Starter
Member
I'm baffled....maybe you can help enlighten me... 
Com2 is installed and working, as listed in the device manager and tested with other applications.
My app runs the following code to verify which Com ports are available for use. If a com port is available a corrosponding option button is enabled -
Dim i as Long
On Error Resume Next
For i = 1 To 8
MSComm1.CommPort = i
MSComm1.PortOpen = True
If MSComm1.PortOpen Then 'port was opened.
MSComm1.PortOpen = False
Option1(i).Enabled = True
MsgBox i & " is a valid port."
Else
Debug.Print "Error " & Err & ", Port " & i & "."
End If
Next
Every CommPort value returns an error. The error codes returned are 8002 (not found) and for Com2 the error code is 8015 (could not set com state.)
Like I said Com2 is a valid com port, and I have used it with other applications.
So what does err 8015 mean is going on? I've tried droping in a new MSComm ctrl and using its default settings just to see if it was a programming error. However that didn't change anything.
As another option I have considered changing the above If statement to work off of the returned error code. I just hate to program it to 'ignore' certain errors when I'm not certain of what they represent.
TIA for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|