View Full Version : saveToFileJPEG() Fuction Routine Error Question..

February 3, 2010, 09:07:51
I use Visual Studio 2008 and C++ MFC Programming.
I make some MFC Dialog base Program with save image function.
I make program base on Sample Code(In CD's).
and use VCD Simple file.
in the Dialog View add one button that is Capture.
and Insert code from website's example code that is

Next is add button program part.
void CVCDSimpleDlg::OnBnClickedCapture()
// TODO:
DShowLib::saveToFileJPEG(*m_Grabber.getActiveMemBu ffer(),"Testimage.jpg",75);

and press F5, Run Program, Select Devie , Image is right,
So I Press "Capture" Button and then...
as I Know the program is capture image and save "TestImage.jpg" File.
Program Debugger stop and display Error Message.
I do not edit other part of the program, Just edit OnBnClickedCapture() part.
So I Request Some advice about programmig

1. How can i fix that Error. Please tell me how edit that program.

2. What is difference between isLive() and startLive()

Please Tell me..
and have a good day

Stefan Geissler
February 3, 2010, 10:10:51

the error message would have been helpful. Please let me now the error message.

DShowLib::saveToFileJPEG(m_Grabber->getActiveMemBu ffer(),"Testimage.jpg",75);

is better. I do not know, whether you implemented m_Grabber as pointer or not. If it is a pointer, use the "->" operator to access its members. If it is no pointer, use the "." operator. I do not recommend to use "*m_Grabber.".

The difference between startlive and islive is:
startlive starts the live video
isLive returns true, if the live video is running and returns false, if the live video is not running.
You may refer to: