First Steps VC.NET

Instantiating the Grabber

Open the file "FirstStepDoc.h", which was created by the AppWizard and add a public member to the class CFirstStepDoc by inserting the line:

DShowLib::Grabber* m_pGrabber;

just below the lines:

// Attributes
public:

Open the file "FirstStepDoc.cpp", which was created by the AppWizard. Create a new Grabber in the constructor of the CFirstStepDoc class. The constructor should then look like the following:

CFirstStepDoc::CFirstStepDoc()
{
    // TODO: add one-time construction code here
    m_pGrabber = new DShowLib::Grabber();
    ASSERT( m_pGrabber );
}

The Grabber object has to be deleted, when the program terminates. To achieve this, change the destructor of the CFirstAppDoc class to the following:

CFirstStepDoc::~CFirstStepDoc()
{
    delete m_pGrabber;
}

In order to verify the changes you have made so far, please build the project by selecting "Rebuild Solution" from the "Build" menu.

Next step: Select a Video Capture Device and display a Live Image