programming vfw capture
I had ever use VFW.May be the section next is of some use to you.
ghCapWnd = capCreateCaptureWindow((LPTSTR)TEXT("Video Window"),
WS_CHILD|WS_VISIBLE|WS_EX_DLGMODALFRAME,
0,0,//400,500,
rect1.Width(),rect1.Height(),
pWnd->GetSafeHwnd(),0);
ASSERT(ghCapWnd);
if(capDriverConnect(ghCapWnd,0))
{
capDriverGetCaps(ghCapWnd,&gCapDrvCaps,sizeof(CAPDRIVERCAPS));
if(gCapDrvCaps.fCaptureInitialized)
{
capPreviewRate(ghCapWnd,33);
capPreview(ghCapWnd,TRUE);//use the memory
}
else{
AfxMessageBox("Failure to initialize video card");
// AfxGetMainWnd()->PostMessage(WM_CLOSE);
}
}
else
{
AfxMessageBox("Failure to connect video card");
//AfxGetMainWnd()->PostMessage(WM_CLOSE);
}