Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mscomm - port already open
Message
From
12/09/2003 00:58:45
 
 
To
11/09/2003 11:53:03
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00828196
Message ID:
00828403
Views:
10
you cannot use a port to which a mouse is connected, as windows would have already opened it.

Also the olecontrol.portopen setting is at best unreliable.Whenever I used the MSComm I always maintained my own flag rather than reading the above property.



>hello all, i am having some problems with the mscomm control. I set all of my properties at design time, but set them again at run time. I have a mouse that can be plugged into com port 1. when the code runs oleComm1.PortOpen = .F., but when i try oleComm1.PortOpen = .T., i get the error port already open, if I try oleComm1.PortOpen = .F., i get the error type mismatch. is there some pc setting i am missing? or something i can do to correct this problem.
>
>Here is the code
>
>ThisForm.oleComm1.CommPort = 1
>
>IF ThisForm.oleComm1.PortOpen = .T. &&TRUE_LOC
> ThisForm.oleComm1.PortOpen = .F. &&FALSE_LOC
> ThisForm.oleComm1.Settings = "9600,n,8,1"
>ENDIF
>
>WAIT WINDOW "OpenCom Port" TIMEOUT .5
>ThisForm.oleComm1.PortOpen = .T. &&TRUE_LOC
>ThisForm.oleComm1.InBufferCount = 0
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform