Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modem Dialing through VFP...
Message
De
16/04/1998 14:33:26
 
 
À
16/04/1998 14:27:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00092631
Message ID:
00092636
Vues:
20
>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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform