Results 1 to 3 of 3

Thread: Device lost problem

  1. #1
    Join Date
    May 2007
    Age
    37
    Posts
    70

    Question Device lost problem

    Dear Sir,
    I am using deviceLost() to find camera unplugging on run time... but it will not find out camera unplugging on run time.... i attached my source code for your reference... plz refer that and find my mistake....

    thanks in advance
    Selvanathan

  2. #2
    Join Date
    Jan 2003
    Location
    Bremen, Germany
    Posts
    4,886

    Re: Device lost problem

    Selvanathan

    Thank you for showing me the project, that makes things much easier for me. I found two errors:

    You wrote
    Code:
    void CListener_Cam1::deviceLost( Grabber& param) 
    {
    	if( m_pParent != NULL)
    	{
    		m_pParent->PostMessage(WM_USER+13,0,0);
    	}
    }
    but your message handler is:

    Code:
    	ON_MESSAGE(WM_USER+1,OnDeviceLost)

    Please change it from "1" to "13".


    The second error is in following line:
    Code:
    m_pGrabber_Cam1->addListener( m_pListener_Cam1, GrabberListener::eFRAMEREADY);
    This advises the listener only to listen to the frame ready, but not to the device lost event. Please write following line instead:
    Code:
    m_pGrabber_Cam1->addListener( m_pListener_Cam1);
    I tested it and your messagebox was shown, when the device was unplugged.
    Best regards
    Stefan
    IC Imaging Control Support

  3. #3
    Join Date
    May 2007
    Age
    37
    Posts
    70

    Re: Device lost problem

    Dear Stefan
    Thank u for u r valuable reply.... now its working fine....
    Selvanathan

Similar Threads

  1. How to trigger device lost function
    By shankar_vizitec in forum IC Imaging Control C++ Class Library
    Replies: 3
    Last Post: September 5, 2008, 13:06:51
  2. Device Lost Problem
    By niranjan in forum IC Imaging Control ActiveX
    Replies: 1
    Last Post: June 13, 2008, 09:12:40
  3. Problem initializing device dialog
    By md_BS in forum IC Imaging Control C++ Class Library
    Replies: 3
    Last Post: December 3, 2003, 13:56:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •