PDA

View Full Version : How can i check whether there is a grabber ?



RedSand
March 29, 2004, 08:29:32
When i want to instanciate a new grabber but there is no device
connected, i get a program crash with this line:

m_pGrabber = new DShowLib::Grabber();

How can i check before this call whether there is a framegrabber connected ?

I am using the DFG/1394-1 and Visual Studio.NET 2003.

Stefan Geissler
March 30, 2004, 07:31:25
Hello,

IC Imaging Control 1.41 is not designed for .NET 2003. Therefore you get a crash. Please send a request to support at imagingcontrol dot com, so i can send you matching DLLs.

To check whether video hardware is connected to your computer, use following code:


DShowLib::Grabber::tVidCapDevListPtr pVidCapDevList = m_Grabber.getAvailableVideoCaptureDevices();
if ( pVidCapDevList != 0 )
{
if ( !pVidCapDevList->empty() )
{
}
else
{
// No hardware found.
}
}