The leading provider of version control solution and TWAIN SDK

Error message: Failed to import the ActiveX control

Symptoms:

When you try dragging the control from the tool box into the form in Microsoft Visual Studio 2005, you may receive the following error message:



Cause:

This is a bug of VS2005 that has been reported to Microsoft. The cause of the problem is the missing of the "Interop.DYNAMICTWAINCTRLLib.dll" file or the "AxInterop.DYNAMICTWAINCTRLLib.dll" file that should be created automatically by system when you add the control to the form.

Resolution:

Method 1:

Another way to create the 2 DLL files easily:

1. Drag the Dynamic Web TWAIN control from the toolbox to the form and the "Failed to import the ActiveX control. Please ensure it is properly registered." error occurs.

2. Select "Build -> Rebuild Solution" to rebuild the project.

3. Drag the Dynamic Web TWAIN control from the toolbox to the form for the 2nd time and the "Failed to import the ActiveX control. Please ensure it is properly registered." error occurs again.

4. Select "Build -> Rebuild Solution" to rebuild the project for the 2nd time.
 
5. Drag the Dynamic Web TWAIN control from the toolbox to the form for the 3rd time and the ActiveX control will be successfully imported this time.

Method 2:

1. Manually create "Interop.DYNAMICTWAINCTRLLib.dll" and  "AxInterop.DYNAMICTWAINCTRLLib.dll" by using AxImp.exe with source code generation. You can use a command like:

AxImp /source activex_control_path_name

The following code shows the importing of the DWT ActiveX control in command line:

C:\>"C:Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\AxImp.exe" /source C:WINDOWS\system32\DynamicWebTwainCtrl.dll

And you can see the output as follows:

Generated Source: C:\AxDYNAMICWEBTWAINCTRLLib.cs
Generated Assembly: C:\DYNAMICWEBTWAINCTRLLib.dll
Generated Assembly: C:\AxDYNAMICWEBTWAINCTRLLib.dll

The "DYNAMICWEBTWAINCTRLLib.dll" file is the same as the "Interop.DYNAMICTWAINCTRLLib.dll" file while the "AxDYNAMICWEBTWAINCTRLLib.dll" is the same as the "AxInterop.DYNAMICTWAINCTRLLib.dll" file.

2. Place these two files into the subdirectory "\obj\Debug" of your project.




Article Details

Last Updated
6th o November, 2008

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (1 vote)

100% thumbs up 0% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Visitor Comments

  1. Comment #1 (Posted by sumit )
    ActiveX control failed to load!- Please check browser security settings
  2. Comment #2 (Posted by payal )
    please mention wht is Dynamic Web TWAIN control and from where we get this control
  3. Comment #3 (Posted by support )
    Dynamic Web TWAIN control is added to the VS ToolBox when you check DynamicWebTwain Class in (VS) Tools->Choose Toolbox Items->COM Components after you installed Dynamic Web TWAIN on the machine.

Post a comment

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
* Enter the code below:
 

Continue