WK Ho
January 6, 2008, 05:49:23
Hi there
I intended to display the captured image on many of my dialog DLL and after having problem of working on a global grabber object I try to pass the object's pointer from one to another.
CWWHPRWND::CWWHPRWND(CWnd *parent,DShowLib::Grabber *ppGrabber) : CWDialog(parent)
{
pppGrabber=ppGrabber;
...
}
I then operate on the pppGrabber locally such as :
if( pppGrabber->isDevValid() )
{
AfxMessageBox( "The device is still Valid" );
}
else
AfxMessageBox( "The device is NOT Valid" );
Which give me positive result.
However, when I try to do some real stuff like:
if (!pppGrabber->getHWND()) //this one OK
AfxMessageBox( "NO ValidsetWND !" );
xhHwnd=GetSafeHwnd(); // get the current dialog hwnd
if (!(pppGrabber->setHWND(xhHwnd)))
AfxMessageBox( "CANNOT SetHWND !" ); //??this line printed...
pppGrabber->setWindowPosition(5, 70 );
pppGrabber->startLive();
Nothing happen on the display ..The message AfxMessageBox( "CANNOT SetHWND !" ); was executed.
Any idea where I go wrong?
Regards
WK
I intended to display the captured image on many of my dialog DLL and after having problem of working on a global grabber object I try to pass the object's pointer from one to another.
CWWHPRWND::CWWHPRWND(CWnd *parent,DShowLib::Grabber *ppGrabber) : CWDialog(parent)
{
pppGrabber=ppGrabber;
...
}
I then operate on the pppGrabber locally such as :
if( pppGrabber->isDevValid() )
{
AfxMessageBox( "The device is still Valid" );
}
else
AfxMessageBox( "The device is NOT Valid" );
Which give me positive result.
However, when I try to do some real stuff like:
if (!pppGrabber->getHWND()) //this one OK
AfxMessageBox( "NO ValidsetWND !" );
xhHwnd=GetSafeHwnd(); // get the current dialog hwnd
if (!(pppGrabber->setHWND(xhHwnd)))
AfxMessageBox( "CANNOT SetHWND !" ); //??this line printed...
pppGrabber->setWindowPosition(5, 70 );
pppGrabber->startLive();
Nothing happen on the display ..The message AfxMessageBox( "CANNOT SetHWND !" ); was executed.
Any idea where I go wrong?
Regards
WK