PDA

View Full Version : Access violation error while setting video format



naveen
February 27, 2014, 14:15:29
Hi,

if( ! DShowLib::InitLibrary( "<inerst license key here>" ) ) // USE YOUR LIBRARY KEY
{

// Save_Log(__FILE__,"InitInstance",__LINE__,"InitLibrary failed");

return FALSE;
}



// Automatically calls ExitLibrary when the program ends.
atexit( DShowLib::ExitLibrary );

if( !m_pGrabber->openDev (m_serialNo) ) // Opens the device.
{
//Fn_Throw_Exp(E_CAM_200002,ERR_ICON); // Throwing error if device cannot open.
AfxMessageBox(L"Cannot opened");
return false;
}

// BSTR bstr;
// WCHAR wsz[81];
// bstr = m_vdoFormat.AllocSysString();
Grabber::tVidFmtListPtr pVidFmtList = m_pGrabber->getAvailableVideoFormats();
m_pGrabber->setVideoFormat(L"BY8 (640x480)");

In above code throwing the following error while setting video format in VC++ 2010.
Unhandled exception at 0x7c821559 in Process.exe: 0xC0000005: Access violation reading location 0xcccccccc.

Kindly help me to come out of this error.

Thanks,
Naveen

Michael Kirmse
February 27, 2014, 14:44:39
Hi Naveen,

In order to investigate the problem, I need a small sample project that is able to reproduce the error.
Unfortunately, the code above is not sufficient.

Thank you in advance.

Stefan Geissler
February 28, 2014, 08:56:19
Hello Naveen,

do you know exactly at which position in your code the access violation occurs?

Do you have other video capture devices installed on your computer? Sometimes, they have drivers stating having a nice property, but when trying to query the property, you may receive an access violation.

Last point: Does the very same happen with IC Imaging Control 3.3? Free download is at http://www.theimagingsource.com/en_US/support/downloads/

naveen
February 28, 2014, 11:25:09
m_pGrabber->setVideoFormat(L"BY8 (640x480)"); this line is causing an issue.If I comment this then i am able to run the program

Stefan Geissler
February 28, 2014, 11:52:55
Hello Naveen,

Which camera model do you use?
What happens, if you do not use the "L" at "(L"BY8 (640x480)")"?

Do you have other video capture devices installed on your computer? e.g. a Creative Labs Webcam?
Sometimes, they have drivers stating having a nice property, but when trying to query the property, you may receive an access violation.