A other code example with the same problem



--------------------------------------------------------------------
Option Compare Database

' Benötigte API-Deklaration
Private Declare Function tapiRequestMakeCall Lib "tapi32.dll" ( _
ByVal lpszDestAddress As String, _
ByVal lpszAppName As String, _
ByVal lpszCalledParty As String, _
ByVal lpszComment As String) As Long

'Declare Function tapiRequestDrop Lib "tapi32.dll" ( _
ByVal hwnd As Long, _
ByVal wRequestID As Long) As Long

Private Declare Function lineClose Lib "tapi32.dll" (ByVal hLine As Long) As Long

Private Const TAPIERR_NOREQUESTRECIPIENT = -2&
Private Const TAPIERR_REQUESTQUEUEFULL = -3&
Private Const TAPIERR_INVALDESTADDRESS = -4&

Sub nummernanwahl()

'Dial("01738054118","")

End Sub

' Windows-Wählhilfe starten und Telefonnummer wählen
Public Function Dial()
'(ByVal sPhoneNumber As String, _
ByVal sRecipient As String, _
Optional ByVal sComment As String = "")

Dim sPhoneNumber As String, sRecipient As String, sComment As String
Dim sBuffer As String
Dim nResult As Long
Dim i As Byte, j As Byte

j = 1

For i = 0 To j

'An example for a invalid number
sPhoneNumber = "00123456789"
sRecipient = ""
sComment = ""

' Wählhilfe starten und Telefonnummer wählen
'nResult = tapiRequestMakeCall(sPhoneNumber, App.ProductName, sRecipient, sComment)
nResult = tapiRequestMakeCall(sPhoneNumber, "", sRecipient, sComment)

nResult = lineClose(7)

' Rückgabewert auswerten
If nResult <> 0 Then
' Fehler!
Select Case nResult
Case TAPIERR_NOREQUESTRECIPIENT
MsgBox "Die Windows Wählhilfe ist nicht installiert" & _
" oder konnte nicht gestartet werden!"

Case TAPIERR_REQUESTQUEUEFULL
MsgBox "Die Anrufschlange ist voll!"

Case TAPIERR_INVALDESTADDRESS
MsgBox "Ungültige Telefonnummer!"

Case Else
MsgBox "Sonstiger Fehler!"

End Select

End If

Next i

End Function
------------------------------------------------------------------------------------
Robert M. wrote:
Hello peoples,

I have a little Tool in VBA Acess, that make from the selected line a call.

You can download the file here:

http://rapidshare.de/files/40053017/tapi-2000.mdb.html

My problems are:

1. I can´t disconnect the call
2. The error responding, how i can determine, that is a invalid number, is not functional and i have no idea, why.

Can my anyone help? I´m a newbie with TAPI and i can´t find a solution :(

Thanks und greetings from Germany,

Robert

P.S.: I hope you can understand my scool-english :)
.



Relevant Pages

  • Re: CryptAPI
    ... > Private Declare Function CryptAcquireContext Lib "advapi32.dll" Alias ... > As String, ByVal dwProvType As Long, ByVal dwFlags As Long) As Long ... > On Error GoTo ErrSign ...
    (microsoft.public.vb.winapi)
  • Re: problem with RegQueryValueEx (long)
    ... >> Function RegGetString(hInKey As Long, ByVal sSubKey As String, ByVal ... > (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long ... > Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias ...
    (microsoft.public.vb.general.discussion)
  • Re: Need to call windows scheduler.
    ... Private Declare Function OpenSCManager Lib "advapi32.dll" Alias ... "OpenSCManagerA" (ByVal lpMachineName As String, ... Dim lhSCM As Long, lhService As Long, sState As String, lReturn ...
    (microsoft.public.access.formscoding)
  • Re: Weird AddIn behaviour
    ... Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias ... "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ... Do While Not (strValue = "Not Found") ...
    (microsoft.public.excel.programming)
  • Re: Message or input
    ... Private Declare Function GetCurrentThreadId Lib "kernel32" _ ... ByVal lpCaption As String, _ ... Dim mbFlags2 As VbMsgBoxStyle ... SetDlgItemText wParam, vbAbort, But1 ...
    (microsoft.public.excel.misc)