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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.