TAPI wrapper

  • Thread starter Thread starter Thomas Hall
  • Start date Start date
T

Thomas Hall

I need to monitor for incoming voice calls on a Pocket PC 2003 Phone
Edition (WinCE 4.2). I downloaded Alex Feinman's Tapi wrapper (v.1.6)
for the call monitor example. Great stuff! Unfortunately, when I
place a call to the device an error is thrown which I narrowed down to
tapilib.dll for which I do not have the source.

TIA,
Thomas
 
Hello Alex,
Thanks for your reply. The error is "INVALCALLHANDLE". This is
happening when the line state goes idle and callObj is disposed before
the following method returns:
From project CallMonitor:

Private Sub callObj_CallState(ByVal [call] As OpenNETCF.Tapi.Call, _
ByVal state As OpenNETCF.Tapi.LINECALLSTATE) Handles callObj.CallState

Select Case state
Case LINECALLSTATE.IDLE
If [call] Is callObj And CurrentLogItem > -1 Then
Dim item As ListViewItem = lvCallLog.Items(CurrentLogItem)
Dim length As TimeSpan = DateTime.Now.Subtract(CallStart)
item.SubItems(2).Text = length.ToString()
CurrentLogItem = -1
callObj.Dispose()
callObj = Nothing
End If

End Select
End Sub

I eliminated the error by moving the callObj.Dispose to the following
method:
Private Sub lineObj_NewCall(ByVal [call] As OpenNETCF.Tapi.Call) _
Handles lineObj.NewCall

If Not (callObj Is Nothing) AndAlso Not (callObj Is [call]) Then
callObj.Dispose()
callObj = Nothing
End If
' Store call object for future use
callObj = [call]

' Code deleted...

End Sub

It appears that callObj was being disposed before the line object was
through referencing it.
 
Hello Alex,

Great work on the TAPI wrapper! You addressed a much needed area. I
have a question, is (was) the TAPI wrapper included in SDF? I'd hoped
to document the class library as I explored its capabilities.

Thanks,
Thomas
 
Back
Top