>I need to ring a series of modems overnight to get back electricity meter
>readings.
>I have 2 PCs and 2 modems on 2 different phone nos. I can get the 2 talking
>using Hyperterminal - the sender outputs ATDT660005 - the receiver waits
>for exactly 2 rings then sends ATA - the CONNECT message is shown and 2 way
>sending of text can take place. When a VFP form sends to a Hyperterminal
>session on the other PC the connection is successful and text can be output
>using mscomm32 OLE object. However when a VFP form wants to receive data
>(and store it in an Editbox or file) using MSCOMM32 the Port will open and
>the connection can sometimes be made to work (ie the CONNECT message is
>displayed) but no data can be sent by the Hyperterminal PC and successfully
>received by the VFP form.
>
>VFP Recive form Open Port and ONCOMM code shown below
>
>HELP Please - Modems are driving me mad!
>
>
>* open port cmd - port won't listen!
>if !thisform.olecontrol1.portopen
> thisform.olecontrol1.portopen=.t.
>endif
>* the following commented out commands had no effect when tested
>*thisform.olecontrol1.output='ATA' &&chr(26) && ready to receive
>*thisform.olecontrol1.output='ATZ'+CHR(13)
>*thisform.olecontrol1.output='AT&F1'+CHR(13)
>*thisform.olecontrol1.output='ATH1S0=1'+CHR(13)
>thisform.olecontrol1.output='ATA'+CHR(13) && ready to receive
>
>
>*** OLE Control Event ONCOMM ***
>*if this.commevent=2 .AND. this.inbuffercount>0
>if this.inbuffercount>0
> thisform.edit1.value=thisform.edit1.value+this.input
>&&allt(str(asc(this.input)))+','
> thisform.edit1.refresh()
>* this.output=chr(26)
>endif
Make sure you set the 'RThreshold' property to 0 in order to activate the OnComm Event. Build an event procedure in the onComm Event(do case.. endcase) to trigger the received event.
Hope can help.
BTW, I've a question. How to distribute the OLE control (*.OCX) with our application ? Assumed that the user site doesn't have VFP, VB.
Thanks