The leading provider of version control solution and TWAIN SDK

Error Message: Unable to get the window handle for the 'AxDynamicTwain' control

Symptoms:

When you compile a Dynamic Web TWAIN application in Visual Studio 2005/2008 on a Vista machine, you may receive the following error message:



Cause:

The program is closed by DEP (Data Execution Prevention).

Resolution:

The following resolutions can be applied to avoid this issue:

Resolution 1:

1. Please set the "NXCOMPAT:NO" bit on the .exe file.

For C#: Go to Project Properties -> Build Events tab

For VB.NET:

1. Go to Solution Explorer, right-click on Project, select Properties
2. Click the Compile tab
3. Click "Build Events..." button

and enter this text in the "Post-build event command line":

call "$(DevEnvDir)..\..\VC\bin\vcvars32.bat"
call "$(DevEnvDir)..\..\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"

2. Please turn off "Enable the Visual Studio hosting process" under the "Debug" tab.  This is because VS makes its own version of the executable, filename appended with .vshost.exe, which doesn't
seem to have the NXCOMPAT bit set, or perhaps it runs as a subprocess of Visual Studio which uses DEP.

Resolution 2:

Turn off DEP. Details





Article Details

Last Updated
3rd o June, 2011

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 (0 votes)

No users have voted.

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 JOHN )
    Great support.... i get it work after try this. Immediate and professional services. Thank you.
  2. Comment #2 (Posted by Akshay)
    It is really needful. work perfectly. Great Solution.

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