General information
Category:
ActiveX controls in VFP
Hi,
I use MSComm32 extensively, but I have never tried to change comm ports programatically after initially assigning them. My form stores "COM1", "COM2", ect... on opening, and then init parses this to initialy assign the port as:
IF .not. Empty(Thisform.ScannerMain)
*!* Initialize the Comm port to read barcode scanner
thisform.comm32.CommPort = INT(VAL(Substr(Thisform.ScannerMain,4,4)))
thisform.comm32.Settings = "9600,n,8,1"
.
.
.
Endif
This assignment has always worked. I then open and close the port in the activate/deactivate methods to allow the com ports to be shared with other programs.
If GETPEM(thisform.comm32,"PortOpen") = .t. && port is open and connected
thisform.comm32.PortOpen = .f. && disconnect port
Endif
Note that I use GETPEM() to determine port status, it has been years so I can't remember if "IF comm32.PortOpen = .t." was a problem or not. It may be that to change com port you have to destroy this instance of MSComm32 and add a new instance programatically. Before such drastic measures, you may want to monitor GETPEM() to visualize the state of PortOpen and CommPort.
Good Luck!
>Hi,
>I tried it your way and still does not work...is it a "BUG"?
>By the way did anyone worked with the activex control web browser? because i included it in a form but i can't make it to open an local html file?
>Alina Panaghiu
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only