Using Dynamic Web TWAIN in Visual C++ Dialog Based Applications
Topics included in this article that describe how to use Dynamic Web TWAIN
in Visual
C++ dialog based applications are:
1. Adding Dynamic
Web TWAIN
to
a Visual C++ Project
2. Adding a Member Variable
Associated with Dynamic Web TWAIN
3. Adding an Event Handler
1. Adding Dynamic Web
TWAIN
to a
Visual C++ Project
- Start Micorosoft Visual C++.
- On the File menu, click New to bring up the New
dialog box.
- In the New dialog box, select MFC AppWizard (exe) project
type and input DynamicWebTwainDlgApp in the Project Name edit box, as seen in
the following figure.

- Click OK button.
- In the MFC AppWizard - Step 1 dialog box, select Dialog based
application type and click Finish button.
- In the New Project Information dialog box, click OK button.
- On the Project menu, point to Add To Project, then click
Components and Controls.
- In the Components and Controls Gallery dialog box , expand the
Registered ActiveX Controls folder, select the DynamicWebTwain Class, click
Insert.
- In the Microsoft Visual C++ dialog box, click OK.
- In the Confirm Classes dialog box, click OK.
- In the Components and Controls Gallery dialog box, click Close
to close the dialog box.
- DynamicWebTwain control will now appear in the Visual C++ dialog editor Toolbox,
as seen in the following figure:

- From this point on, you can use Dynamic Web TWAIN in the same way as other
controls.
- So far, Dynamic Web TWAIN ActiveX Control has been imported into DynamicWebTwainDlgApp project, and a wrapper class called
CDynamicWebTwain has been
generated by Visual C++ IDE, as seen in the following figure:

2. Adding a Member Variable
Associated with Dynamic Web TWAIN
- Place a Dynamic Web TWAIN control in a dialog.
- Press Ctrl-W to invoke MFC ClassWizard.
- In the MFC ClassWizard dialog box, click Member Variables
tab, as seen in the following figure:

- In the MFC ClassWizard dialog box, click Add Variable
button.
- In the Add Member Variable dialog box, input m_DynamicWebTwain (or
other name) in the Member Variable Name edit box, click OK.
- From this point on, you can call the member functions of the m_DynamicWebTwain
to communicate with the ActiveX Control. Every property or method in Dynamic
Web TWAIN
ActiveX Control has corresponding function in m_DynamicWebTwain.
3. Adding an Event Handler
- In the MFC AppWizard dialog box, click Message Maps tab. In
this page, all the Events of Dynamic Web TWAIN are listed, as seen in the following
figure:

- You can select the event you want to handle, such as OnPostTransfer,
then click Add Function to add an event handler.
- In the Add Member Function dialog box, click OK.
- Add code in the event handling function.
TWAIN ActiveX | TWAIN Plug-in | TWAIN Control | TWAIN SDK | Scanner COM
Software Configuration Management | Version Control | Source Control
Copyright © 2009 Dynamsoft Corporation. All Rights Reserved.