Information générale
Catégorie:
Contrôles ActiveX en VFP
The error occurs when the program tries to open CommPort:
"mscomm1.PortOpen = .t."
>>>>With VFP 7.0 in Windows 2000 i am trying to send data to a POS display connected to serial port 1 with the following code:
>>>>
>>>>* Comm 1 with 9600 baud, no parity, 8 data, and 1 stop bit.
>>>>mscomm1.CommPort = 1
>>>>mscomm1.Settings = "9600,n,8,1"
>>>>mscomm1.PortOpen = .t.
>>>>mscomm1.Output = CHR(12) + "test..."
>>>>mscomm.PortOpen = .f.
>>>>
>>>>But i receive an error message when the program tries to open the door, this is the message: "OLE IDispatch exception code 0 from MSComm: Could not set comm state, there may be one or more invalid communications parameters...".
>>>>
>>>>Why did this happened? the port is really serial port 1, and i think that the parameters are OK, at least when i print a test page from the printer driver (i also defined this POS display as a printer), with the same parameters this display works well.
>>>>
>>>>Somebody help me...
>>>>
>>>>Thank you
>>>
>>>What is CHR(12) ?
>
>
>Can't seem to reproduce it here, what line is the error on?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement