TAPI wrapper

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
 
T

Thomas Hall

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.
 
T

Thomas Hall

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top