VC 谁能改这个错误啊
请大伙帮忙啦,急需:
错误提示:unhandled exception in capvideo.exe(MFC.DLL):0x0000005: Access Violation
错误所在函数:
void CCapvideoView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
CWnd *pWnd=GetDlgItem(IDC_PICTURE);//把图型控件作为捕获窗的父窗口,得到该窗口的句柄
CRect rect;//用来表示捕获窗的大小
pWnd->GetWindowRect(& rect);//得到父窗口的大小
gWndCap=capCreateCaptureWindow("capturewindown",WS_CHILD|WS_VISIBLE,0,0,rect.Width(),rect.Height(),pWnd->GetSafeHwnd(),1);
//该函数返回捕获 窗的句柄,该句柄在后面要经常用到。
ASSERT(gWndCap);//判断捕获窗创建是否成功
if (capDriverConnect(gWndCap,0))//判断连接是否成功,0为默认的USB口
{
capDriverGetCaps(gWndCap,&gCapDrvCaps,sizeof(CAPDRIVERCAPS));//获取捕获驱动器的能力
if(gCapDrvCaps.fCaptureInitialized)//判断初始化是否成功
{
capPreviewRate(gWndCap,66);//设置显示频率
capPreview(gWndCap,TRUE);//开始预览显示
}
else
{
AfxMessageBox("Initialization is failed!");
}
}
else
{
AfxMessageBox("Link capture drive is failed!");
}
}