PDA

View Full Version : RunTime error come from ICContainer.dll



vdaanen
July 30, 2007, 17:07:26
Hi,

I'm facing to a runtime error I can not debug because the callstack reported by the debugger only contains DLLs supplied by ImagingSource.

In the first attachment, you can see the callstack.
In the second one, I bordered in red the only "warning" I do not understand nor solve.

V

Stefan Geissler
July 31, 2007, 08:15:22
Hello Vincent,

Thank you for your images. I am not able to help you, because I do not know what you are doing. Sorry for this. The message you show are, as you wrote, whithout any useable information.

The most effective way to narrow down such problems, is to create a small project, that reproduces this error. In this case, we would have the same source code, we could exchange.

vdaanen
August 7, 2007, 17:16:03
Hi,
the problem I mentionned a week ago appears when I'm rendering a video signal in a view using m_Grabber::setHWND().

You can see my code below.


LOGMSG("Trying to attach to window...");

if (!m_Grabber.isDevOpen())
{
LOGERR("No Grabber available. Can't attach video to a window.");
return false;
}

if (!p_hWnd)
{
LOGERR("Invalid Window Handle. Can't attach video to a window.");
return false;
}

if (m_Grabber.getHWND() ==p_hWnd)
{
LOGMSG("Trying to attach a second time to the same window ! Skipping.");
return true;
}

// stop the grabber
if (m_Grabber.isLive())
{
m_Grabber.stopLive();
while(m_Grabber.isLive())
{ };
}

// Allocate a display
bool r=m_Grabber.setHWND(p_hWnd);
if (r)
{
m_pSink->setSnapMode(false);
m_pSink->setSinkMode(GrabberSinkType::eRUN);
m_Grabber.setSinkType( m_pSink );

m_Grabber.startLive(true);
while(!m_Grabber.isLive())
{ };

LOGMSG(" CVideoGrabberImplImagingSource::AttachToWindow : OK");
}
else
LOGERR(" CVideoGrabberImplImagingSource::AttachToWindow : FAILED");

return r;


After a few seconds of rendering, the application fails with the "messages" I mentionned in the first post of this thread.

The failure occurs when I try to acquire an image while the direct rendering is running.

Hope this helps to solve my problem

Vince

Sascha Schmidt
August 8, 2007, 16:14:24
Hallo Vincent,

here is a small sample...


void CVincentDlg::OnBnClickedSetHwnd()
{
// stop the grabber
if (m_cGrabber.isLive())
{
m_cGrabber.stopLive();
while(m_cGrabber.isLive())
{ };
}

if ( m_pSwitch )
m_cGrabber.setHWND(m_pVideo2.m_hWnd);
else
m_cGrabber.setHWND(m_cStaticVideoWindow.m_hWnd);

m_pSwitch = !m_pSwitch;

pSink->setSnapMode(false);
pSink->setSinkMode(GrabberSinkType::eRUN);
m_cGrabber.setSinkType( pSink );

m_cGrabber.startLive();

}

void CVincentDlg::OnBnClickedSaveImage()
{
pSink->getLastAcqMemBuffer()->save( "C:\\image.bmp" );
}Basically it makes the same, I think...changing the grabber-hwnd and saving images while rendering. It works fine and I cant reconstruct the error.

vdaanen
August 8, 2007, 17:17:05
Hi Sasha,

your example does not perform the same action that my application :
in my application, I start the direct rendering and then uses snapImages (or asyncSnapImages).

E.g. I have a timer that requests for detecting if a video signal is present (using snapImages(1,50)) every 300 ms.

After a few seconds (50 to 60 s), the application crashes.
If I desactivate the timer, then the application can run for weeks.

It seems that using snapImages (or asyncSnapImages) while rendering directly the video flow causes an exception.

This afternoon, I replace the IC-3.0 direct rendering by my own code and I have to manage a flag in order to prevent the direct rendering to perform while a snapImages.

Is there a way to manage the direct rendering dynamically ?

Vince

Sascha Schmidt
August 14, 2007, 12:13:14
Hi Vincent,

please send me a small sample, that shows the problem.
My email: sascha.schmidt@theimagingsource.com

vdaanen
August 23, 2007, 10:28:49
Hi Sasha,

sorry but I can't send any source since we use external librairies with NDA.

But I solved the problem by using a flag as I mentionned above.

V