Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSComm Control
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00567453
Message ID:
00568136
Views:
40
I tried a different approach and used some code from Microsoft (article "Q139526"):

PUBLIC ComForm
ComForm = CREATEOBJECT('Form')
ComForm.AddObject("Testcom","Olecontrol","MSCOMMLib.MSComm")
ComForm.Testcom.CommPort = 2 && Use Comm2, The second Serial Port.
ComForm.Testcom.Settings = "14400,N,8,1" && 14.4 Kbaud, No Parity,
&& 8 data Bits, 1 Stop Bit
ComForm.Testcom.PortOpen = .T.
ComForm.Testcom.Output = "ATDT555-1234" + chr(13) && Dialing the number
* The chr(13) is needed to complete the modem command sequence
ComForm.Testcom.PortOpen = .F.
***** End Code *****

I've made some changes (commport should be 1 instead of 2, and baud rate should be 9600) and the result was absolutely the same error message: "OLE IDispatch exception code 0 from Mscomm: could not set comm state, there may be one or more invalid communications parameters..."

There is something to do with security options in Windows 2000? Or there is some problem with this piece of code?

Thank you,

Joaquim

>>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:
>
>My personal preference is to use OPOS ActiveX controls for working with POS equipment whenever possible. Does your manufacturer ship one?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform