Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. RTC problem

RTC problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpvisual-studioquestionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    minihotto
    wrote on last edited by
    #1

    I run the program by Microsoft Visual Studio 2005 on the Windows® XP operating system. I try to run the basic program of RTC. There is no compile error, but there is a run-time error. ==> hr = pIDispatch->QueryInterface (IID_IRTCSessionStateChangeEvent,reinterpret_cast (&pISessionState)); The error message is __vfptr = CXX0030: Error: expression cannot be evaluated. The code is followed. Can somebody tell me where is the problem? #include "stdafx.h" #define _WIN32_DCOM #include #include #include #include #include #include #include #include #pragma comment(lib, "ole32.lib") #pragma comment(lib, "Uuid.lib") using namespace std; int _tmain(int argc, _TCHAR* argv[]) { HRESULT hr = S_OK; CoInitializeEx(NULL,COINIT_APARTMENTTHREADED); IRTCClient *pIRTCClient; hr = CoCreateInstance( CLSID_RTCClient, NULL, CLSCTX_INPROC_SERVER, IID_IRTCClient, reinterpret_cast (&pIRTCClient) ); hr = pIRTCClient->Initialize(); long lEventMask; lEventMask = RTCEF_ALL; hr = pIRTCClient->put_EventFilter(lEventMask); DWORD dwEventCookie; IUnknown *pUnknown = NULL; IConnectionPointContainer *pCPC = NULL; IConnectionPoint *pCP = NULL; hr = pIRTCClient->QueryInterface( IID_IUnknown, reinterpret_cast (&pUnknown) ); hr = pIRTCClient->QueryInterface( IID_IConnectionPointContainer, reinterpret_cast (&pCPC) ); hr = pCPC->FindConnectionPoint( IID_IRTCEventNotification, &pCP ); hr = pCP->Advise( pUnknown, &dwEventCookie ); pCP->Release(); pCPC->Release(); pUnknown->Release(); hr = pIRTCClient->put_ListenForIncomingSessions( RTCLM_BOTH ); BSTR bstrLocalURI = NULL; BSTR bstrDestURI = NULL; RTC_SESSION_TYPE SessionType; IRTCSession *pIRTCSession = NULL; IRTCProfile *pIRTCProfile = NULL; SessionType = RTCST_PC_TO_PC ; // Specify session type if(SessionType == RTCST_PHONE_TO_PHONE){bstrLocalURI = SysAllocString(_T("tel:+14255550123"));} bstrDestURI = SysAllocString(_T("sip:22500@163.22.20.154")); hr = pIRTCClient->CreateSession( SessionType, bstrLocalURI, pIRTCProfile,RTCCS_FORCE_PROFILE,&pIRTCSession ); IRTCParticipant *pIRTCParticipant; hr = pIRTCSession->AddParticipant( bstrDestURI, NULL, &pIRTCParticipant ); hr = pIRTCSession->Termin

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups