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.htmhttp://www.microway.com.au/greenleaf/commx.stmHere'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:
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