TWAIN ActiveX Control, Plug-in, Scanner SDK, Component, HTTP Control/SDK

Dynamsoft TWAIN Products

Support Community for TWAIN Control/Component/SDK for Scanning Solutions
* Login   * Register
* FAQ    * Search

It is currently Thu Feb 09, 2012 10:03 am




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Using Dynamic TWAIN in VC++ Dialog Based Applications
PostPosted: Tue Mar 08, 2005 1:41 am 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1067
Adding Dynamic TWAIN to a Visual C++ Project

1. Start Micorosoft Visual C++.
2. On the File menu, click New to bring up the New dialog box.
3. In the New dialog box, select MFC AppWizard (exe) project type and input DynamicTwainDlgApp in the Project Name edit box, as seen in the following figure.

Image

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

Image

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

Image

Adding a Member Variable Associated with Dynamic TWAIN

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

Image

4. In the MFC ClassWizard dialog box, click Add Variable button.
5. In the Add Member Variable dialog box, input m_DynamicTwain (or other name) in the Member Variable Name edit box, click OK.
6. From this point on, you can call the member functions of the m_DynamicTwain to communicate with the ActiveX Control. Every property or method in Dynamic TWAIN ActiveX Control has corresponding function in m_DynamicTwain.

Adding an Event Handler

1. In the MFC AppWizard dialog box, click Message Maps tab. In this page, all the Events of Dynamic TWAIN are listed, as seen in the following figure:

Image

2. You can select the event you want to handle, such as OnPostTransfer, then click Add Function to add an event handler.
3. In the Add Member Function dialog box, click OK.
4. Add code in the event handling function.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

It is currently Thu Feb 09, 2012 10:03 am


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog