A in house program not work on WIN7 unless DEP is completely turned off.

We have a in-house program written by Visual Studio 2005 VB6 and being compiled in a Windows XP platform.   The program has been working fine on the XP environment until when run it on a WIN7 Platform, it shows error message "unable to get the window handle for the "AxVSFlexGrid' control.  Windowless ActiveX controls are not supported".  

After doing some research, we have found a command "bcdedit.exe /set {current} nx AlwaysOff " to turn DEP off and it works in WIN7.

We have tried to turn off that particular exe file from the exception list from the WIN7 DEP but getting a message "This program must run with data execution protection (DEP) enabled.  You cannot turn off DEP for this program. "

We do not have this issue or need to turn off anything in Windows XP.  

Experts, please advise if you have any clue.

Many Thanks.
Who is Participating?
from an MSFT response
There are three possible causes for why you cannot add the app to the
exceptions list:
1.) This is a 64-bit application.
2.) The application is in the Windows directory.
3.) The application has been compiled for Vista and, therefore, DEP is
enforced for it.

Since it is in-house have it rebuilt for any OS.
nav2567Author Commented:
Sorry.  I have read that article.  None of those.  

The program was compiled in a XP platform.  
Ok, then the application has been detected doing bad things executing from memory.  Have you updated to the latest release of FlexGrid? A quick search showed me there were problems with older versions and DEP
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

nav2567Author Commented:
Tomasp, would you explain?  What is the fix of the older version of DEP?

I found this:

Starting with Framework 2.0 SP1 every compiled image contains the IMAGE_DLLCHARACTERISTICS_NX_COMPAT Flag in the PE Header. This means that an application that is compiled with VS2005 or VS2008, with .NET 2.0 SP1 installed, can not use older ActiveX-Controls (e.g. from third parties) which are using ATL 7.1 or earlier. DEP (active in Vista by default, inactive in XP by default) detects an access violation when the constructor of the ActiveX-Control is called.

So, basically that means that you'll just have to turn off DEP for the application (like you've already done).

Or get a newer version of the application that behaves properly
nav2567Author Commented:
Thanks everyone.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.