Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modem Dialing through VFP...
Message
From
16/04/1998 19:09:48
 
 
To
16/04/1998 14:33:26
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00092631
Message ID:
00092727
Views:
21
>>Trying to dial the phone using modem through COM1 in VFP. No luck!
>>
>>I've got the routine below:
>>---------------------------
>>
>>function dialer
>>parameters telnum,cport
>>
>>local keypress, handle, tcom, dialstr
>>
>>* cport = 1
>>* telnum = alltrim(str(telnum))
>> dialstr="ATDT"+telnum
>> WAIT 'Press Enter to Dial, any other key to cancel' WINDOW NOWAIT
>> keypress=INKEY(0,'H')
>> IF keypress = 13
>> tcom='COM'+alltrim(str(cport))
>> handle=FOPEN("&tcom",12) && attempt to open port
>> IF handle < 0
>> WAIT "Can't Open Communications Port, Check Setup" WINDOW
>> RETURN
>> ENDIF
>> =FPUTS(handle,dialstr) && dial number
>> WAIT 'Dialing... Lift Phone and press any key' WINDOW
>> =FPUTS(handle,"ATH") && hang up modem
>> =FPUTS(handle,"ATZ") && init modem
>> =FCLOSE(handle)
>> ENDIF
>>ENDFUNC
>>
>>
>>I keep getting the error in the routine "Can't open ...port."
>>
>>Any ideas? I'd really rather not purchase a $300 comm package and complicate VFP further. Why won't this work? My modem is on COM1 with IRQ4 and works just fine through other programs in W95.
>>
>>TIA!
>>
>>Mark
>
>VFP comes with a limited comm OCX, MSCOMM.. This should do what you want. There is a doc on it's usage in the libraries here too!


Tony,

Thanks -- forgot about that, but probably just suppressed it; I tried it once and never got it to do anything. I'll check out the UT library.

Thanks again,

Mark
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform