LRESULT CRevPlayMDIChildWnd::OnPrepareToClose(WPARAM wParam, LPARAM lParam)
{
CWnd* pRevPlayWnd = (CRevPlayWnd*)GetDlgItem(IDC_REVPLAY_WND);
pRevPlayWnd->SendMessage(WM_USER_PREPARE_TO_CLOSE);
WaitForSingleObject(CRevPlayThread::m_hEventRevPlayThreadKilled, INFINITE);
return 0;
}
// CRevPlayWnd
CRevPlayWnd::CRevPlayWnd()
{
m_LostBlock=0;
m_Receive=FALSE;
m_Save=FALSE;
m_FirstRead=TRUE;
m_RenderOk=FALSE;
m_Stop=FALSE;
rIndex=0; //pRevMem数组的标记
g_rwIndex=0;
m_pStream=NULL;
m_rdr=NULL;
m_pifg = NULL;
m_pigb = NULL;
m_pimc = NULL;
m_pivw = NULL;
m_ppos = NULL;
hmmioSave = NULL;
}
CRevPlayWnd::~CRevPlayWnd()
{
}
BEGIN_MESSAGE_MAP(CRevPlayWnd, CWnd)
//{{AFX_MSG_MAP(CRevPlayWnd)
ON_WM_CREATE()
ON_COMMAND(IDR_SAVE, OnSave)
ON_WM_CONTEXTMENU()
ON_COMMAND(ID_STOP_RECEIVE, OnStopReceive)
ON_COMMAND(IDR_REV_PLAY, OnRevPlay)
ON_UPDATE_COMMAND_UI(IDR_SAVE, OnUpdateSave)
ON_UPDATE_COMMAND_UI(ID_STOP_RECEIVE, OnUpdateStopReceive)
ON_WM_SIZE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_USER_ONCMDMSG, OnDelegatedCmdMsg)
ON_MESSAGE(WM_USER_PREPARE_TO_CLOSE, OnPrepareToClose)
ON_MESSAGE(WSA_CONNECT,OnConnect)
ON_MESSAGE(WSA_READ,OnRead)
END_MESSAGE_MAP()