Kyle
Kyle

Reputation: 136

.NET application referencing ActiveX components cause Access Violation Exception in Windows 10

An application built with .NET uses ActiveX components from 2004. Specifically ComponentOne VSPDF and VSPRINTER version 8.

These components are used in a DLL to generate a PDF and then send an email. This application has been working perfectly until Windows 10, where the application crashes. The message just says "PROGRAM has stopped working". The EventLog shows errors with the code c0000005 - "Access Violation Exception".

We have tried the following:

  1. Added the program to DEP list - no effect.

  2. Installed redistributable file VS++ 2005 - no effect.

  3. Registered OCX files - no effect.

  4. Added the components directly to the .NET form - application no longer starts.

I know, from searching the internet, that this error code means that the program is trying to access protected (or corrupted) memory. But then how does it work in Windows 7 and not in Windows 10?

Some people are also saying that it is a security update. But then how do we work around it? We can't now go around uninstalling security updates on customers computers...

We have narrowed it down to an environmental problem, but have no idea what to do next...

Does anyone have some alternative advice?

Upvotes: -1

Views: 758

Answers (1)

Kyle
Kyle

Reputation: 136

It turns out that just adding the program to the DEP list doesn't help. Sometimes you have to force "Compatible with Data Execution Prevention" to off.

Instructions:

  1. Run Visual Studio Developer Command Prompt as Administrator
  2. Run the following command to apply the flag for "No Excecution Combatibility":
  3. c:>editbin /NXCOMPAT:NO "Program.exe"

References:

Data Execution Prevention

Compatible with Data Execution Prevention

Upvotes: 0

Related Questions