Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using MSCOMM32 in VFP

Status
Not open for further replies.

JonusQ

Programmer
Jan 30, 2004
5
US
Hello all.

I have been tasked with writing a program that will dial up a BBS and download a file. I am trying to use MSCOMM32 and can get as far as dialing the BBS, but from there I do not know what is happening. I cannot tell if my login and password are successful or the command to download a file is successful, etc.

When I suspend the program all I have in the oComForm.MbxCom.Input is “CONNECT 14400”.

Am I sending the login information correctly? I have never had to write a program that accesses the modem before, so any help would be greatly appreciated.

My program code is below

Thanks.
Rt

************
*: Initialize object for MSCOMM32
PUBLIC oComForm
oComForm = CREATEOBJECT('Form')
oComForm.AddObject("MbxCom","Olecontrol","MSCOMMLib.MSComm")
oComForm.MbxCom.CommPort = 3 && Use Comm3, The third Serial Port.
oComForm.MbxCom.Settings = "14400,N,8,1" && 14.4 Kbaud, No Parity,
&& 8 data Bits, 1 Stop Bit
*: Open com port
oComForm.MbxCom.PortOpen = .T.
*: Dial the number. The chr(13) is needed to complete the modem command sequence
oComForm.MbxCom.Output = 'ATDT555-555-5555' + chr(13)
WAIT TIMEOUT 28
*: Send logon id & password
oComForm.MbxCom.Output = loginid + chr(13)
WAIT TIMEOUT 3
oComForm.MbxCom.Output = password + chr(13)
WAIT TIMEOUT 3
*: Send command to download a file
oComForm.MbxCom.Output = "$$REQ ID=loginid BID='XXXXXXXXANSI835'" + chr(13)
WAIT TIMEOUT 60
lcReceived = oComForm.MbxCom.Input
*: Send logoff command and hang-up
oComForm.MbxCom.Output = 'LOGOFF' + chr(13)
oComForm.MbxCom.Output = "ATH0" + chr(13)
*: Close the com port
oComForm.MbxCom.PortOpen = .F.
*suspend
RELEASE oComForm
************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top