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
AviCap.cpp
Package: 停车场管理系统.zip [view]
Upload User: trilite
Upload Date: 2007-04-24
Package Size: 261k
Code Size: 2k
Category:
Hotel software system
Development Platform:
Visual C++
- // AviCap.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ParkSys.h"
- #include "AviCap.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // AviCap
- CAviCap::CAviCap()
- {
- }
- CAviCap::~CAviCap()
- {
- }
- BOOL CAviCap::capInit(CWnd* pParentWnd, int tx, int ty,
- int bx, int by, int avi_WindowID,
- int DeviceIndex)
- {
- m_hWndCap = capCreateCaptureWindow((LPSTR)"Capture Window",
- WS_CHILD|WS_VISIBLE,
- tx,ty,bx,by,
- pParentWnd->GetSafeHwnd(), avi_WindowID);
- capDriverConnect(m_hWndCap, DeviceIndex);
- capOverlay (m_hWndCap, TRUE);
- if (m_hWndCap == NULL)
- return FALSE;
- //设置错误处理函数
- capSetCallbackOnError(m_hWndCap, CAviCap::ErrorCallbackProc);
- return TRUE;
- }
- void CAviCap::capClose()
- {
- capOverlay(m_hWndCap, 0);
- capDriverDisconnect(m_hWndCap);
- }
- /////////////////////////////////////////////////////////////////////////////
- // AviCap message handlers
- // ErrorCallbackProc: error callback function
- // hWnd: capture window handle
- // nErrID: error code for the encountered error
- // lpErrorText: error text string for the encountered error
- //
- LRESULT CAviCap::ErrorCallbackProc(HWND hWnd, int nErrID, LPSTR lpErrorText)
- {
- if (!hWnd)
- return FALSE;
- if (nErrID == 0) // Starting a new major function.
- return TRUE; // Clear out old errors.
- // Show the error identifier and text.
- CString strMsg;
- strMsg.Format("%s。错误号:%d", lpErrorText, nErrID);
- AfxMessageBox(strMsg, MB_OK | MB_ICONEXCLAMATION);
- return (LRESULT) TRUE;
- }