PDA

View Full Version : How to trigger device lost function



shankar_vizitec
September 5, 2008, 11:39:57
HAI THIS IS SHANKAR
I NEED TO USE USE DEVICE LOST FUNTION IN MY PROGRAM AS LIKE FRAMEREADY I LIKE TO USE THIS DEVICELOST FUNCTION IN MY PROGRAM, EVEN TOUGH I REGISTER FOR THIS FUNCTION IN ADDLISTENER WITH PARAMETER eALL BUT THE FUNCTION IS NOT TRIGGERED WHEN I UNPLUG THE CAMERA .

Stefan Geissler
September 5, 2008, 12:49:09
The DeviceLost function is a member of the GrabberListener class. You must inherit your own class from the GrabberListener class and implement the DeviceLost method.

After doing so, you must add your GrabberListener inherited object to the grabber object using the method "Grabber::addListener()";

Please refer to:
http://www.imagingcontrol.com/en_US/support/documentation/class/GrabberListener.htm

You may also have a look into the "Callback" sample of IC Imaging Control.

shankar_vizitec
September 5, 2008, 14:03:26
thank for to reply
i follow all the above steps which u prescribe even tough i didnt trigger devicelost function.
first i inherit my class(by name listener) to grabber listener and then i call addlistener function with listener class object and eALL as parameter, then i implement devicelost function to display warning message (using afxmessage box)


:rolleyes: frameready function is workingproperly

Stefan Geissler
September 5, 2008, 14:06:51
Hi,

The parameter call seems to be correct. I guess, you use a DCAM camera or a video capture device, that really can be disconnected from the computer. If you use a PCI Framegrabber and an analogue camera and you removed the camera, then the framegrabber stays in the computer and works properly. Thus the "Device Lost" event is not fired.