Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Phone Calls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00125007
Message ID:
00125063
Vues:
17
>Is there a VFP class out there to make a phone call using the PC instead of the phone? (Don't ask...;)
>
>Eric K.
Hi Eric.

Do you mean you want the program to dial a telephone number in a file for purposes of conversation? If so, this code should work for you provided you have FoxTools.fll loaded:

LOCAL lcNum2Dial, LcComPort, lcdstring, lnport

THISFORM.uRetVal = .T.

lcNum2Dial = ALLTRIM(THISFORM.TxtPrefix.Value)
IF LEFT(ALLTRIM(THISFORM.TxtPhone.Value),3) = ALLTRIM(THISFORM.TxtLocalArea.Value)
lcNum2Dial = lcNum2Dial + RIGHT(ALLTRIM(THISFORM.TxtPhone.Value),7)
ELSE
lcNum2Dial = lcNum2Dial + "1" + ALLTRIM(THISFORM.TxtPhone.Value)
ENDIF
lcNum2Dial = lcNum2Dial + ALLTRIM(THISFORM.TxtSuffix.Value)

lccomport=THISFORM.cboComPort.Value
lcdstring = "ATDT " + lcNum2Dial + CHR(13)

opencomm = RegFn("OpenComm", "CII", "I", 'User.exe')
writecomm = RegFn("WriteComm", "ICI", "I", 'User.exe')
closecomm = RegFn("CloseComm", "I", "I", 'User.exe')

lnport = CallFn(OpenComm, lccomport, 100, 100)

=CallFn(WriteComm, lnport, lcdstring, len(lcdstring))

=MESSAGEBOX("Dialing "+ALLTRIM(lcNum2Dial)+CHR(13)+CHR(13)+;
"Pick up the phone and press any key", 64)

lcdstring=CHR(10)+CHR(13)+CHR(10)+CHR(13)

=CallFn(WriteComm, lnport, lcdstring, len(lcdstring))
=CallFn(CloseComm, lnport)

Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform