Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mscomm - port already open
Message
De
23/09/2003 08:54:43
 
 
À
11/09/2003 11:53:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00828196
Message ID:
00831425
Vues:
21
>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.
>
Hello Randy;

Just change the position of the first statment:
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.CommPort = 1        && <--- here it will work fine
ThisForm.oleComm1.PortOpen = .T. &&TRUE_LOC
ThisForm.oleComm1.InBufferCount = 0
U can't set the commport to 1,2,3,4.. If the first statment: IF ThisForm.oleComm1.PortOpen is true.. But, only if .f.


HTH


Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform