PDA

View Full Version : crashing



Unregistered
May 30, 2004, 18:10:41
Hello,
We have developed a MS Visual C++ SDI application with Imaging Control. User can record .avi's and .bmp's any time with the application. So the video recording part of our code is like that

...

if(m_pGrabber->isLive())
m_pGrabber->stopLive();

DShowLib::Avisink AvisinkInst("new file name.avi", ...);
m_pGrabber->setSinkType(Avisink);

m_pGrabber->setMemBufColl(m_pGrabber->newMemBufColl(5));

m_pGrabber->startLive();

...

Also, the user can pause recording for a while and run again which is handled in other part of the code. Now here is my question. During the call of the startLive() and stopLive() functions our program crashes sometimes and sometimes not. The error message says that the instruction at 0x... referenced memory 0x..., read error, such that. In addition, sometimes when we close the application we face with the error message "DDE Server Window: ....exe Application error: the instruction at 0x... referenced memory 0x..., read error". We could not find the problem. Colud you give any suggestion? Thanks.

Stefan Geissler
June 1, 2004, 10:11:20
Hello,

I can only speculate about your problem too. Fist of all,
startLive() should not used in the OnInitialUpdate() methods of your application.
A membuffer collection is not needed for AVI capture.

If you use some ActiveX Controls in your application, you should insert following code in one your files:


struct static_init
{
static_init() { CoUninitialize(); OleInitialize( 0 ); }
};

#pragma init_seg( user )
static_init sys_init;