PDA

View Full Version : getAvailableVCDProperties() error



nikkadim
September 19, 2012, 20:21:56
Could you please explain, why getAvailableVCDProperties() crashed with this code:


bool RemoteGrabber::startCapture( int frames_to_capture)
{

DShowLib::InitLibrary();

Grabber gr;
bool bok = gr.openDev("DMx 22BUC03");
if( bok ) {
tIVCDPropertyItemsPtr pItems = gr.getAvailableVCDProperties();
}

[...]

}



PS: I did not use IC Wizard (if it's important) when created project in MSVC2010, because I use QT wizard. All other methods work good, but I need to modify settings like exposure, and as I understand I have to use getAvailableVCDProperties() for it.

Thank you.

Michael Kirmse
September 21, 2012, 09:56:59
Hello nikkadim,

which error message do you get?

nikkadim
September 21, 2012, 16:33:16
My app crashes when I call getAvailableVCDProperties().

Stefan Geissler
September 21, 2012, 16:54:59
I am very sorry, but "crash" is no valid error message. You will receive an exception, I guess. I think, it may is a NULL pointer or access violation. I would like you to check this. It is also a good idea, to check this in a standalone project, like the "callback" sample and see, what happens in there.

Also the sequence
bool RemoteGrabber::startCapture( int frames_to_capture)
{
DShowLib::InitLibrary()

looks for me, that you call Initlibrary each time, you want to handle the camera. InitLibrary initializes internally the Windows COM library too, so too many calls to InitLibary can messup your Windows. InitLibrary() should be called once in your entire application.

nikkadim
September 22, 2012, 15:15:28
Sorry, for my english, yes, you are right it is exception.
And yes I have called DShowLib::InitLibrary() for each capture proccess, but at the end of this function I call ExitLibrary();.
And as I said above all other methods works good, for example:



bool RemoteGrabber::startCapture( int frames_to_capture)
{

DShowLib::InitLibrary();

Grabber gr;
bool bok = gr.openDev("DMx 22BUC03");
if( bok ) {
tFPSListPtr pFPS = gr.getAvailableFPS();
}

[...]
ExitLibrary();
}


...works just fine, why?

PS: Thank you for advice, I'll will try to call InitLibrary() once in main.
PPS: Sorry for bother you every day, but I just what to understand that I using this product (camera and Lib) right. I'm really like your cameras and I have good results under Linux with CMOS cameras, and now I just need to make sure that's all works right under Windows. And thanks for your patience!

Stefan Geissler
September 24, 2012, 16:19:28
Hi

I tried the very same code you posted and have no problem. Therefore, I wonder, what error is shown in the exception you receive.


PPS: Sorry for bother you every day, but I just what to understand that I using this product (camera and Lib) right. I'm really like your cameras and I have good results under Linux with CMOS cameras, and now I just need to make sure that's all works right under Windows. And thanks for your patience!

You are welcome!

nikkadim
October 11, 2012, 00:22:03
You are right the problem was in initialization. Strangely, because I had problem only with getAvailableVCDProperties(), other methods in my app worked good.