This section describes creating a simple automation client applications with Microsoft Visual C++ V5. It assumes that you are somewhat familiar with that environment. The target application will be a dialog based application with a button to cause Webcam32 to start an immediate FTP session.
Start Visual Studio 97
Select File, Select New
Select the Projects tab
Select MFC AppWizard (EXE)
Give the project a name (wc32test)
Click OK
Select Dialog based
Click Finish
You should now have a default Dialog based application. Compile and run and the following dialog should appear

Change the dialog using the Resource editor within Visual Studio to include a button (IDC_FTP) and remove the Cancel button. The resulting dialog should look like:

Using the ClassWizard, add a handler for the FTP button to call OnFtp when pressed

This is the magic part. Webcam32 supplies a file called the Type Library. This file contains an interface description of the methods exported and usable from Webcam32 itself. To utilize this Type Library, we create a new class using the class wizard.
In the ClassWizard, click Add Class
Select "Create from a Type Library ..."
Select the Webcam32_2.tlb file
Accept the confirmation of the creation of the new class
This will create a new class and can be seen in theWorkspace pane as follows:

In the stdafx.h header file, add the following to include MFC OLE definitions:
#include
In the CWinApp::InitInstance() method, add the following line which will load and activate OLE support
if (!AfxOleInit())
{
AfxMessageBox("Failed to initialize OLE");
return FALSE;
}
In dialog class, include the IWebcam32API header file and add a member variable which is public to access Webcam32
#include "webcam32_2.h" ...
public: IWebcam32API m_Webcam32;
In the handler for the dialog FTP Now!! button press, invoke the Webcam32 interface method FtpNow()
void CWc32testDlg::OnFtp()
{
m_Webcam32.FtpNow();
}
You are now all done. Compile the program, start Webcam32 and run the new application. Press the Ftp Now!! button and Webcam32 will perform an immediate FTP upload.