View Full Version : Device lost problem

October 13, 2008, 15:16:48
Dear Sir,
I am using deviceLost() to find camera unplugging on run time... but it will not find out camera unplugging on run time.... i attached my source code for your reference... plz refer that and find my mistake....

thanks in advance

Stefan Geissler
October 13, 2008, 16:33:20

Thank you for showing me the project, that makes things much easier for me. I found two errors:

You wrote

void CListener_Cam1::deviceLost( Grabber& param)
if( m_pParent != NULL)

but your message handler is:


Please change it from "1" to "13".

The second error is in following line:

m_pGrabber_Cam1->addListener( m_pListener_Cam1, GrabberListener::eFRAMEREADY);
This advises the listener only to listen to the frame ready, but not to the device lost event. Please write following line instead:

m_pGrabber_Cam1->addListener( m_pListener_Cam1);

I tested it and your messagebox was shown, when the device was unplugged.

October 14, 2008, 04:05:34
Dear Stefan
Thank u for u r valuable reply.... now its working fine....