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
