IC Imaging Control C++

First Steps VC.NET

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

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us