Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MScomm class definition
Message
From
31/05/2005 15:45:43
 
 
To
31/05/2005 15:33:31
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018748
Message ID:
01018815
Views:
34
Hi Mark,

>VFP is a buggy product. That's for one.
>What should work right from the box, does not.
>So, I am trying to find a workaroud.

I've found VFP to be a very stable and solid product. I've followed this thread and still don't know what you're trying to accomplish from a big picture perspective.

I don't think you will find many fans of MSCOMM - it is not a great control - regardless of your development tool. If you're writing production software, I would encourage you to invest in a 3rd party COMM component.

Two suggestions off the top of my head (there are many more out there):

http://www.magnacartasoftware.com/CommTools.htm
http://www.microway.com.au/greenleaf/commx.stm

Here's a code MSCOMM snippet I grabbed off one of the VFP forums. I'm sorry I don't know who the original author is. Perhaps this snippet might give you some ideas? You might also consider googling VFP and MSCOMM32.OCX to find other examples.
Create a form, drop the activeX MSCOMM32 control onto it and call it oComm

Drop a button onto the form

Form Init() procedure:

* Set up Comms Parameters
with ThisForm.oComm
    .CommPort=5
    .Settings="9600,E,7,1"
    *
    .RThreshold=1
    .Portopen=.T.
    if not .Portopen()
            =MessageBox("Invalid Port")
            return .F.
    endif
    *
endwith
*
Return

And in the Button Click() Procedure:

Local I
Local cStr
With Thisform.oComm
    cStr="UUUU"
    for I=1 to len(cStr)
            .Output=(substr(cStr,I,1))
    endfor
    *
Endwith
=Messagebox("Data Sent")
*
Return
Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform