OpenClipboard
Hi, I have the following code:
BOOL CVideo::CaptureFrame()
{
HBITMAP m_hBmp = NULL;
CBitmap m_bmp; //bitmap object
capGrabFrame(hWndC); // macro that sample a single frame from the
// camera.
capEditCopy(hWndC);
EmptyClipboard();// simple macro that edit a copy of the frame.
OpenClipboard();
// m_hBmp is a Handle to Bitmap.
m_hBmp = (HBITMAP)::GetClipboardData(CF_BITMAP);
CloseClipboard();
m_bmp.Detach(); //cleaning the bitmap.
m_bmp.Attach(m_hBmp); //connecting the bitmap throw the handle.
return true;
}
I call this function when i want to capture a frame. But, when I call
OpenClipboar, an assertion failure window is pop out, and the program
fails.
Can anybody please explain why the OpenClipboard function fails?
I want to save a .bmp file. I could save a avi frame using the
following statements:
capFileSetCaptureFile(hWndC, "c:\\myCapturedFrame");
capCaptureSingleFrameOpen(hWndC);
capCaptureSingleFrame(hWndC);
capCaptureSingleFrameClose(hWndC);
but that pice of code generates an myCaptureFrame.avi, but I need a
..bmp file.
Thanks for your time.