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.

.



Relevant Pages

  • Re: Automating call-out alignment in double-page documents
    ... I think the macro below will do what you want. ... the macro finds out which page number the frame is on. ... "Suzanne S. Barnhill" wrote: ... Word MVP FAQ site: http://word.mvps.org ...
    (microsoft.public.word.pagelayout)
  • Re: Automating call-out alignment in double-page documents
    ... the macro finds out which page number the frame is on. ... Word MVP FAQ site: http://word.mvps.org ...
    (microsoft.public.word.pagelayout)
  • Re: Macro doesnt perform
    ... I am still preplexed why I can insert frame ... but if I record a macro of performing those ... > Public Sub FrameMaker() ... > Set MyFrame = ActiveDocument.Frames.Add ...
    (microsoft.public.word.vba.general)
  • Re: MACRO SHOTS QUESTION
    ... is no longer as "usefully precise" as "filling the frame with a field ... It always worked for different sizes of film; macro is a property of ... the film or sensor is 1mm across it is macro. ... frame with the same subject you have not taken a macro photograph. ...
    (rec.photo.digital)
  • Re: MACRO SHOTS QUESTION
    ... is no longer as "usefully precise" as "filling the frame with a field ... that size does have macro capability, which seems to be more confusing ... x 36 mm subject I am taking a macro photograph, when you fill a 4 x 5 mm frame with the same subject you have not taken a macro photograph. ...
    (rec.photo.digital)