Click to See Complete Forum and Search --> : Vfw


Chirieac
May 13th, 2008, 01:34 PM
Hello! what I'm doing wrong:

hWndC = capCreateCaptureWindow(L"My Capture Window", WS_CHILD | WS_VISIBLE, 0, 0, 320, 240, (HWND) m_hCanvas, 0);

capDriverConnect(hWndC, 0);

capPreviewRate(hWndC, 30);
capPreview(hWndC, TRUE);

capSetCallbackOnFrame(hWndC, vfwOnFrame);

When I call this from a button: capGrabFrame(hWndC) I get run-time errors and the debugger show that this line of code is the problem.

Please help! Bye!

Chirieac
May 14th, 2008, 05:49 AM
Hello! The problem was in the callback function:
was LRESULT vfwOnFrame (HWND window, LPVIDEOHDR header)
and must be LRESULT CALLBACK vfwOnFrame (HWND window, LPVIDEOHDR header)
(forgot to add the CALLBACK keyword)(stupid me)

If I've post it the callback function too in the first place...
Sorry, and bye bye!