I wanna use IRTCMediaEvent's object in a Function, but Icant do it as it is
void CDlgMain::OnIRTCMediaEvent(IRTCMediaEvent mediaEvent)
{
RTC_MEDIA_EVENT_TYPE mediaType;
HWND hwnd=m_Animate1.m_hWnd;
m_Animate1.SetParent(thisDlg);
mediaType = mediaEvent.EventType;
switch (mediaType)
{
case RTCMET_STARTED:
{
// Get the video receive interface for the preview video window
// and specify the RTCVD_PREVIEW enumeration value.
// Get the Ivideo window interface.
m_pIRTCClient->get_IVideoWindow(RTCVD_RECEIVE, &pIRecvVideo);
pIRecvVideo->put_AutoShow(TRUE);
pIRecvVideo->put_WindowStyle(WS_CHILD|WS_CLIPCHILDREN|WS_MINIMIZE|WS_OVERLAPPED);
pIRecvVideo->put_Owner((OAHWND) NULL);
hr=pIRecvVideo->put_Owner((OAHWND) hwnd);
//If (hr != S_OK), process the error here.
if (hr=S_OK)
AfxMessageBox("Parent Window Failed");
// Get the handle of the video window rectangle/control area
// needed to get the size and coordinates of the video area.
RECT rectPos;
rectPos.left=500;
rectPos.top=0;
rectPos.right=1000;
rectPos.bottom=1000;
//AfxMessageBox("initialize Video.",MB_OK);
//
// Insert code to get the rectangle coordinates here.
//
// Set the video window coordinates.
pIRecvVideo->SetWindowPosition( rectPos.left,
rectPos.top,
rectPos.right,
rectPos.bottom );
// If (hr != S_OK), process the error here.
// Show the video window.
pIRecvVideo->put_Visible(TRUE);
}
break;
// Clean up the video window and set to NULL.
case RTCMET_STOPPED:
{
// DShow IVideoWindow SDK
// Note: Do not close the video window without
// releasing the video or removing ownership of the
// video window from the parent window.
pIRecvVideo->put_Visible(FALSE);
pIRecvVideo->put_Owner(NULL);
pIRecvVideo->Release();
pIRecvVideo = NULL;
}
break;
case RTCMET_FAILED:
{
AfxMessageBox("No Video");
}
break;
}
}
Can anyone willl help out to solve the issue.

