Re: Cannot (re)create new TAPI event listener in same session in VB



Kristian,

that shouldn't occur normally, we have tested some modems that remain in
an undefined state when the remote side disconnects, you may check the
modem log to see what is really going on here.
At least with Unimodem all connections should get disconnected when
you ::Shutdown the TAPI object (= lineClose). Maybe your modem hangs
for some reason...?

Just as a general suggestion I think it would be better to keep the TAPI
object during the lifetime of your application, not only during the form's
lifetime.


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------

"Kristian Frost" <kfrost@xxxxxxxxx> wrote in message
news:op.tcxwqeh3l8r4f3@xxxxxxxxxxxxxxxxxxxxxx
On Tue, 18 Jul 2006 20:13:12 +0100, Matthias Moetje [MVP]
<moetje@xxxxxxxxxxxxxxxxxxx> wrote:

You should call :Shutdown only once (remember that you have
just two interfaces to the same object) and you need to release
the first object before assigning the new one.

Blatantly obvious things about COM objects I really should already have
realised no. 431.
D'oh.

You are right that you need to create the object to a variable
declared without WithEvents. The reason for this is that the
event interface is aggregated onto the TAPI object just
during :Initialize is called. Though, you don't need to keep both
objects.
Here's the minimum code required:
' ******************************************************
Dim WithEvents objTAPI As TAPI
Private Sub Command1_Click()
Dim objTmp As TAPI
Set objTmp = New TAPI3Lib.TAPI
objTmp.Initialize
Set objTAPI = objTmp
objTAPI.EventFilter = 0
End Sub
Private Sub Command2_Click()
objTAPI.Shutdown
Set objTAPI = Nothing
End Sub
' ******************************************************
Best regards,
Matthias Moetje

Okay, that sorts out that problem. Thanks very much.

However, now that I've started looking at going in and out of forms, I've
discovered that my modem doesn't seem to be shutting down correctly at the
end of a call and, as a result, cannot be called again within the same
instance of the program.
This is the case both immediately after hanging up and after exiting and
reentering the form (TAPI having been Shutdown and reInitialized by doing
that).

However, while the normal procedure (call, hang up, close form and shut
down TAPI) blocks reconnection, shutting down the form while the call is
connected, and therefore shutting down TAPI mid-call, frees up the modem
properly, allowing me to make a new call when I restart TAPI.

The method I am using to disconnect my call is
"objCallControl.Disconnect(DC_NORMAL)", as well as having performed
several other calls on objAddress to get its ITCollection of calls, and
calls on objBasicCallControl to get the data handle for the datamodem
communications of the call.

Am I disconnecting the call incorrectly in some way? It just seems strange
that some kind of disconnect would cause a failure of the modem, and
another would keep it active.

Kristian
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


.



Relevant Pages

  • Re: [tapi] zoom modem, c++ , disconnect problem,debug
    ... application that call to a number, sends a wav sound, and than waits ... The problem is that sometimes I receive a DISCONNECT in the callback, ... TAPI does this because UniModem.TSP notifies TAPISRV about a disconnect. ... UniModem.TSP itself does this because the modem says (s. ...
    (microsoft.public.win32.programmer.tapi)
  • Re: TAPI help required problem with WinXP
    ... with modem, I guess). ... I have tried with tapi browser, there XP did not get crashed but after ... If I disconnect call from my software then everything works fine. ...
    (microsoft.public.win32.programmer.tapi)
  • Re: TAPI and SIP
    ... Do you know how to hook up to the SIP message stream to catch 'disconnect' ... The line device my app uses is a modem. ... USB device simulates a phone line and gives a dialtone. ... TAPI / TSP Developer and Tester ...
    (microsoft.public.win32.programmer.tapi)
  • Re: need help, voice problem
    ... > for the first time it does disconnect call but not release modem. ... See my TAPI and TSPI FAQ: ... * Please post all messages and replies to the newsgroup so all may ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Cannot (re)create new TAPI event listener in same session in VB
    ... just two interfaces to the same object) and you need to release ... Dim WithEvents objTAPI As TAPI ... However, now that I've started looking at going in and out of forms, I've discovered that my modem doesn't seem to be shutting down correctly at the end of a call and, as a result, cannot be called again within the same instance of the program. ... The method I am using to disconnect my call is "objCallControl.Disconnect", as well as having performed several other calls on objAddress to get its ITCollection of calls, and calls on objBasicCallControl to get the data handle for the datamodem communications of the call. ...
    (microsoft.public.win32.programmer.tapi)