Help, How to handle Participant Event

Help, How to handle Participant Event

Post by CCLe » Sat, 25 May 2002 19:27:45



Help...
I create a IP multicast conferene, but how to know a new participant join
this conference.

I follow the samples incoming and outgoing of TAPI.
first, I register the my TAPI event handler..
then if the TAPI event occur, my event handler can receive this event.
My problem is that I can receive the TE_PRIVATE, but I cannot get the
interface IID_ITParticipantEvent
anyone can tell me how to do these..
thanks..

///////////////  these are the code of register event...

   CTapiEventNotify *pTAPIEventNotification = new
CTapiEventNotify(ghMainFrame);

    hr = RegisterTapiEventInterface(pTAPIEventNotification);
  if ( FAILED(hr) )
    {
        AfxMessageBox("RegisterTapiEventInterface failed");
        return FALSE;
    }//else gpMsgBox->ShowMessage("RegisterTapiEventInterface ok\n");

    //
    // no longer need a reference to the callback object. tapi will keep a
    // reference to it for as long as it is using it.
    //
  pTAPIEventNotification->Release();

    // Set the Event filter to only give us only the events we process
    m_pTapi->put_EventFilter(TE_CALLNOTIFICATION| TE_PRIVATE| TE_CALLSTATE|
TE_CALLMEDIA);

//////////////////// these are the TAPI event handler...
HRESULT TapiEventHandler(TAPI_EVENT TapiEvent, IDispatch * pEvent)
{
    HRESULT hr;
    switch ( TapiEvent )
    {
          case TE_PRIVATE:
               HandleParticipantEvent (pEvent);
                break;

//////////////////// these are the participant event handler...
/////////////////// it is always response E_NOINTERFACE  (no interface)
HRESULT HandleParticipantEvent (IDispatch * pEvent)
{
 HRESULT hr;
 ITParticipantEvent * pParticipantEvent;
 PARTICIPANT_EVENT eventType;
    hr = pEvent->QueryInterface( IID_ITParticipantEvent, (void
**)&pParticipantEvent );

 if ( FAILED(hr) ) {
  if(hr==E_NOINTERFACE )
   gpMsgBox->ShowMessage("QueryInterface IID_ITParticipantEvent
E_NOINTERFACE\n");
  else
   gpMsgBox->ShowMessage("QueryInterface IID_ITParticipantEvent failed\n");
  return hr;
    }else gpMsgBox->ShowMessage("QueryInterface IID_ITParticipantEvent
ok\n");

 
 
 

1. Help, How to handle Participant Event

Help...
I create a IP multicast conferene, but how to know a new participant join
this conference.

I follow the samples incoming and outgoing of TAPI.
first, I register the my TAPI event handler..
then if the TAPI event occur, my event handler can receive this event.
My problem is that I can receive the TE_PRIVATE, but I cannot get the
interface IID_ITParticipantEvent
anyone can tell me how to do these..
thanks..

///////////////  these are the code of register event...

   CTapiEventNotify *pTAPIEventNotification = new
CTapiEventNotify(ghMainFrame);

    hr = RegisterTapiEventInterface(pTAPIEventNotification);
  if ( FAILED(hr) )
    {
        AfxMessageBox("RegisterTapiEventInterface failed");
        return FALSE;
    }//else gpMsgBox->ShowMessage("RegisterTapiEventInterface ok\n");

    //
    // no longer need a reference to the callback object. tapi will keep a
    // reference to it for as long as it is using it.
    //
  pTAPIEventNotification->Release();

    // Set the Event filter to only give us only the events we process
    m_pTapi->put_EventFilter(TE_CALLNOTIFICATION| TE_PRIVATE| TE_CALLSTATE|
TE_CALLMEDIA);

//////////////////// these are the TAPI event handler...
HRESULT TapiEventHandler(TAPI_EVENT TapiEvent, IDispatch * pEvent)
{
    HRESULT hr;
    switch ( TapiEvent )
    {
          case TE_PRIVATE:
               HandleParticipantEvent (pEvent);
                break;

//////////////////// these are the participant event handler...
/////////////////// it is always response E_NOINTERFACE  (no interface)
HRESULT HandleParticipantEvent (IDispatch * pEvent)
{
 HRESULT hr;
 ITParticipantEvent * pParticipantEvent;
 PARTICIPANT_EVENT eventType;
    hr = pEvent->QueryInterface( IID_ITParticipantEvent, (void
**)&pParticipantEvent );

 if ( FAILED(hr) ) {
  if(hr==E_NOINTERFACE )
   gpMsgBox->ShowMessage("QueryInterface IID_ITParticipantEvent
E_NOINTERFACE\n");
  else
   gpMsgBox->ShowMessage("QueryInterface IID_ITParticipantEvent failed\n");
  return hr;
    }else gpMsgBox->ShowMessage("QueryInterface IID_ITParticipantEvent
ok\n");

2. 8514a graphics library needed

3. Any TAPI equivalent to event handling of MSCOMM to handle unsolicited messages ?

4. HLP: stepping across files in GBD

5. Can I use multiple event handles for Winsock events?

6. Java Programmers FAQ

7. HELP :::: Handle windows cut and paster events

8. Power Supply Question - Replacing...

9. * Event Handling In Objects. Help Needed *

10. URGENT help : SMTP server events - inbound events

11. Help with Event Logging (description for Event ID)

12. VMR event handling different from earlier renderer?

13. SetEvent() on un-waited Event Handle