0

I'm developing a C# application and made a (.chm) help file to link it with, and I use the following statement to open help file:

Help.ShowHelp(this,HelpFileLocation);

And the help file opens correctly, but when I close the help file window, the application terminates and the debugging stops, and when looking at the output window I see this:

app.exe has exited with code -1073741819 (0xc0000005) 'Access violation'

I tried to call the method from more than one form and I'm getting the same problem.

EDIT: this is a GIF describes the problem: https://archive.org/download/chm_20200125/chm.gif

Ahmed Suror
  • 439
  • 6
  • 17
  • try running app has an admin and see – Clint Jan 25 '20 at 13:08
  • you can also try this for further debugging , `Debug -> Options and Settings -> Debugging -> General -> Enable Just My Code"` – Clint Jan 25 '20 at 13:17
  • @Clint The problem isn't in the debug only, but also when run without debugging – Ahmed Suror Jan 25 '20 at 13:18
  • yes but by enabling the above setting, you might be able to narrow down your issue – Clint Jan 25 '20 at 13:19
  • @Clint I'll give it a try – Ahmed Suror Jan 25 '20 at 13:24
  • @Clint `Just My Code` is already enabled and no further debug info :( – Ahmed Suror Jan 25 '20 at 16:30
  • Did you try running your exe as admin and could you pls update your question with some code as to how you're invoking your chm file – Clint Jan 25 '20 at 16:56
  • How do you close the help file window? Where resides your CHM file in a subfolder of your app? Can you open by double click and close the CHM without problems? – help-info.de Jan 25 '20 at 18:20
  • @Clint - Run as admin didn't help. - Closing the help file the simple way of "X" button. - CHM location doesn't matter. - I can open by double click and close the CHM without problems. – Ahmed Suror Jan 25 '20 at 18:39
  • Sounds a Registry issue. Try your application in another machine. And check [this](https://wikifixes.com/en/errors/0x/0xC0000005/?gclid=CjwKCAiA66_xBRBhEiwAhrMuLaarVK0Ix7gVzLk0mfVg0sti9l7vnI1REMJ6QMHr-iqKKMElFKoAwBoCxNkQAvD_BwE). –  Jan 25 '20 at 19:08
  • @Clint this is a gif of the problem https://archive.org/download/chm_20200125/chm.gif – Ahmed Suror Jan 25 '20 at 19:12
  • is it necessary to use Help.Show, why not try process.start ? – Clint Jan 25 '20 at 19:14
  • I tried this in WPF and it worked without error `Help.ShowHelp(null,HelpFileLocation);` – Clint Jan 25 '20 at 19:15
  • already used `null`, anyway I made a webhelp instead of html, thanks for your time – Ahmed Suror Jan 25 '20 at 19:16

1 Answers1

0

Maybe this thread can help you. Open CHM (help file) in C#

Access violation.. Maybe the app is not executed with the rights to open the file? Maybe it has to be executed with admin privileges? Or the file is opened in another application already?

Shendayan
  • 31
  • 7
  • This is the problem https://archive.org/download/chm_20200125/chm.gif – Ahmed Suror Jan 25 '20 at 19:12
  • Google says that (0xc0000005) 'Access violation' is a memory access violation. Maybe after closing the help window your program is using a pointer or something to some point in memory, where you shouldn't go? – Shendayan Jan 25 '20 at 19:28
  • This is exactly what I am thinking, but how to figure it out !!?? – Ahmed Suror Jan 25 '20 at 19:40
  • 1
    I am afraid this is a problem that I can no longer help with. Maybe this Site helps you. [link](https://www.stellarinfo.com/blog/how-to-fix-error-code-0xc0000005-in-windows/) – Shendayan Jan 25 '20 at 19:45