?? revplaythread.cpp
字號:
// RevPlayThread.cpp : implementation file
//
#include "stdafx.h"
#include "winsock2.h"
#include "RevPlayThread.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
HANDLE CRevPlayThread::m_hEventRevPlayThreadKilled;
/////////////////////////////////////////////////////////////////////////////
// CRevPlayThread
IMPLEMENT_DYNCREATE(CRevPlayThread, CWinThread)
CRevPlayThread::CRevPlayThread()
{
}
CRevPlayThread::~CRevPlayThread()
{
}
BOOL CRevPlayThread::InitInstance()
{//創建接收播放窗口
// TODO: perform and per-thread initialization here
CWnd* pParent = CWnd::FromHandle(m_hwndParent);
CRect rect;
CoInitialize(NULL);
pParent->GetClientRect(&rect);
//創建接收播放窗口
BOOL bReturn = m_wndRevPlay.Create(_T("接收播放"),
WS_CHILD | WS_VISIBLE, rect, pParent);
//將m_pMainWnd設置為新創建的CRevPlayWnd窗口
//保證當CRevPlayWnd窗口被刪除時,線程被自動刪除
if(bReturn)
m_pMainWnd = &m_wndRevPlay;
return bReturn;
}
int CRevPlayThread::ExitInstance()
{
// TODO: perform any per-thread cleanup here
CoUninitialize();
return CWinThread::ExitInstance();
}
BEGIN_MESSAGE_MAP(CRevPlayThread, CWinThread)
//{{AFX_MSG_MAP(CRevPlayThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRevPlayThread message handlers
CRevPlayThread::CRevPlayThread(HWND hwndParent):m_hwndParent(hwndParent)
{
}
void CRevPlayThread::operator delete(void *p)
{
SetEvent(m_hEventRevPlayThreadKilled);
CWinThread::operator delete(p);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -