Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mscomm32 problems
Message
 
To
26/09/2001 08:47:12
Alina Panaghiu
Smart Computers
Arad, Romania
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00560849
Message ID:
00560909
Views:
19
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
Map
View

Click here to load this message in the networking platform