Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
RevPlayThread.cpp
Package: Visual C++视频音频开发实用工程案例精选.rar [view]
Upload User: tuheem
Upload Date: 2007-05-01
Package Size: 21889k
Code Size: 2k
Category:
Multimedia Develop
Development Platform:
Visual C++
- // 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);
- }