EAccessViolation Error in application running Windows 10 - c#

I've been using this certain application among previous windows versions (Windows XP-Vista-7-8-8.1) and it has worked perfectly without having any issues, after upgrading to Windows 10 though it started showing EAccessViolation error and spams the place with message boxes saying "Runtime error at XXXX" (memory address)
So what I've been trying to achieve is creating a program in C# which runs the application under all compatibility modes one by one, to check which one works and which one doesn't - and sadly, none of them did.
The application is not mine and has stopped development.
Do you guys have any idea what has changed in Windows 10 code-wise, and how am I able to fix this issue? Is there a way to fully emulate another windows version and run it for this application alone? (Without having to set up a Virtual PC or anything)
Thank you in advance.
Note: Microsoft said that Windows 10 is completely backwards compatible, which it doesn't seem like it? The application does not use any driver, it's just a standalone EXE coded in C++/Lua.
Note2: The EXE calls a DLL which might be outdated for Windows 10, any idea what to do about the DLL? Is there a way to make it work as it did in previous windows?

You can help prevent these kinds of errors from occurring by updating your device drivers after formatting and reinstalling your operating system or installing a Windows Updates. Always install the latest Windows Updates before going through and updating your device drivers.

Related

Windows Forms Application Crash After Starting To Use SQLite-net-pcl only on some computers

I used OLEDB in a C# Windows Forms Application but then I decided to change everything to SQLite-net-pcl because it was easier for me.
After I finished everything, made sure there was no bugs - it works only in 2 out of 7 computers. What can I do?
I've seen that people use SQLite-NET, is it the same? Can it work?
I've tried restarting the computers, re-building. I also tried to open a file that doesn't contain anything associated with the SQL-net-pcl reference and it worked.
It crashes right when there is a file with SQL (main file).

getactiveObject command fails for windows 8 and windows 10

I have the following Powershell code below that i've compiled into an executable (.exe) file and have packaged it into SCCM to push against several 100 users. I have setup the SCCM package to run as "Install as user" and not as an Administrator. The package successfully captures the data for users with Windows 7, but any user that has Windows 8/10 installed fails to capture the data I need.
I did a try/catch statement and get this error - "
Exception calling "GetActiveObject" with "1" argument(s): "Operation
unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))"
I'm trying to understand why the same exact code works perfectly on Windows 7 machines, but does not work on Windows 8/10. Is there a fix? I would like to avoid using "New-Object -ComObject 'Outlook.Application'" because i don't want to create a new Outlook process in the background (fear of corrupting user's running Outlook session). I need to run the Powershell code to capture the active running Outlook process. Please help. Thank you
$mail = [Runtime.Interopservices.Marshal]::GetActiveObject('Outlook.Application')
$name = $mail.Application.DefaultProfileName
output of $name is stored locally to a log text file.
Make sure Outlook and your app are running in the same security context - either both apps are running with elevated privileges ("Run As Administrator") or neither app is running as an admin.
I was experiencing similar symptoms. I don't know if this is your exact problem, but maybe my solution will help someone else who stumbles across this issue.
The following MS KB article mentions that Office applications do not register themselves in the ROT until the application loses focus (which is apparently "behavior by design"). If the application is not registered in the ROT, GetActiveObject will return the error you indicated.
In my case, the script was working reliably on Windows 7, but it only sometimes worked on Windows 8. For some reason, perhaps related to the versions of Office installed, different versions of Internet Explorer (which I used to launch the Office apps) or maybe changes to Windows itself, I experienced different default window focusing behavior on Windows 8. As soon as I manually clicked on the Office app in my Windows 8 tests, the script started working.
To solve the problem, I just inserted a call to focus the Office application window before making the GetActiveObject call, which made the operation completely reliable on Windows 8.

C# application doesn't work at my PC

I've saw several Thread about similar problems. But I couldn't find proper answers for my situation. Please Help.
I have a application(about 10,000 line) developed on my PC(Windows7 64bit). Target platform is x86, and .NET version is 4.5.2. It is works fine when I run it on my PC in Visual Studio 2015 Debugging mode. It is works fine too, when I make it setup package, and install on my 4 friend's PCs and test. (A- window7 32bit, B - windows vista 32bit, C - windows7 64bit, D - windowsXP 32bit)
Just on my PC and, E - windows XP 32 bit, It isn't work.
On E, Installer isn't work. Error occur. And on my PC, Installer works properly, Install is completed perfectly. But when I run it, it doesn't show window form. just show me hourglass, beside mouse pointer....
All of tested PC have .NET 4.5.2, and up-to-date service pack.
Anyone know about this situation? Please Help.
As many have stated, the .net version you used is not working on XP.
This kind of things happens to me, when i forgot to properly add image resources to the project, or if some path to a file is not dynamic.
Many of my colleagues usually use a path to images like M:\Images\bla.jpg, and when come to school, of course there is no M disk.
Of course my examples are pretty newbie, but usually when something is not working as its supposed to, check the trivial things first =D
I believe that you haven't handled an exception the right way (although in most cases you would get an error message, but it happend to me that it doesn't).
As others suggested you, try add a logging system to the application, maybe this could solve you out.
Sometimes it helps if you rebuild the solution or code analyse.
Good luck!

.NET 4 Program written/compiled on Windows 7 machine won't run on XP

I have an app that I wrote using C# .NET 4.0 in Visual Studio 2010 on my Windows 7 Ultimate machine. This app works fine on both Vista and other Windows 7 computers, but whenever someone running Windows XP tries to run it it crashes.
In order to reproduce this I've tried running it on my Win XP VMWare machine and it crashes for me in there. Unfortunately it doesn't give me any specific error, just informing me that the program has crashed and needs to close.
One other user sent me the following:
Run-time error '339'
Component 'vbalSGrid6.ocx' or one of its dependencies not correctly registered: a file is missing or invalid.
Code 0xe0434352
Flags 0x00000001
I don't get that particular bit when I try to run it on my Virtual XP machine, and I also made sure to install .NET 4.0 on there.
What could be causing this, and why won't the app run in XP if the .NET 4 framework is supported for XP?
Components used in the program: DataGridView, ComboBox, Buttons, Labels, LinkLabel, NewtonSoft's JSON parser, and that's about it.
I am baffled and have utterly no idea where to start. Ideas?
UPDATE: Hmm, tried running my other recently created application on XP and it loaded fine. The only major difference (in the components I used anyway) between the two is my use of NewtonSoft's JSON library, which I actually think is a .NET 3.5 component.
UPDATE 2: Just for kicks I tried running the program on my Wind7 machine in "Windows XP SP3" compatibility mode and it ran fine. Of course, I have no idea just how closely the "compatibility mode" emulates a true XP SP3 environment, but I figured I'd give ya'll the info anyway.
¡¡ IT WAS THE APPLICATION ICON !!
I kept noticing that the module it referenced in the error it gave me was system.drawing which I thought was odd. I figured perhaps the PictureBox I was using was causing the issue, so I tried disabling everything to do with that, to no avail.
I had my business partner set up his XP box so that we'd have another machine to test with aside from my VMWare XP box just in case there was some odd issue with it.
After he got it set up and the app copied over he said "The icons look like DOS ones" and I had a eureka moment.
I was using .PNG's as the icons because they support transparencies and whatnot, but XP doens't natively support them. So when the app was copied to the desktop it just used a generic icon for it, and when the application was run it crashed because XP doesn't know how to render a .PNG.
Try using the Fusion Log Viewer to debug startup errors in .NET applications.
Scott Hanselman has written a nice howto along with links to further resources if you need to go deeper.
Are we sure this is some wierd .NET compatibility issue or just a run of the mill bad installer/deployment problem?
Here's one user who has that error message because the OCX DLL was copied to System32 with a shortname. Renaming the DLL to the correct name and running RegSvr32 resolved his problem.
Do you have an installer? Have you correctly identified all of your managed and unmanaged dependencies and properly authored them into your installer?
http://forums.elmsoftware.com/forum_posts.asp?TID=119

C# app runs in Windows 7, but not in Windows XP

I have created an application in VS C# Express 2008 using Windows 7 as my OS. It runs perfectly fine on other W7 machines, but when we try and deploy it on a machine with XP it doesn't even run. I just get the usual "Application needs to be terminated" error message. The app was built using .NET 3.5 and all the machines have at least 3.5 installed. Is there anything that I may be able to do to get the program running in previous versions? Thanks in advance for your help.
Updated Info. The machines all use x86 32-bit OS, either XP SP3 or W7, so I don't think that there is a huge need for checks for 64-bit issues. The application itself is loading images into an image list and adding in an image when it finds a break in the file names. (eg. There are 4 images in a folder, 1-3 and 5, what the application does is iterates through each image name and the minute it sees that image 4 is missing, it adds a placeholder image and labels it image 4.)
You should set up an UnhandledExceptionEventHandler so that you can log information about the current state of your application and the exception information. It isn't going to stop your application from crashing, but it will give you more information about what happened and make it easier on your end user to give you what you need to know when the application crashes.
This article give a good description of how to do that.
First you must be sure that .Net Framework 3.5 is installed on your Windows XP machine. If everything is OK, then you should check if you are using "3rd party dlls as reference" and validate their existence and correct versions on your Windows XP machine.
Probably this can help.
Log the exception which is thrown by the application so that you can fix it.
Not a lot of info but some things to check:
Make sure you have the latest patches on XP and SP release
Maybe you need to run the program as administrator - are you logging in as admin
Have you checked the windows appliation error log to see if there is anything there that might be helpful

Categories