Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION Topic is solved

Ask for help, how to use AHK_H, etc.
uhwok3n
Posts: 30
Joined: 15 May 2020, 23:08

Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

27 Jun 2020, 20:25

@HotKeyIt

I'm having this error when I run my compiled program the first time, My Avast Antivirus stops the execution of my compiled executable and AHK_H has this issue.
keyboard_hook_error.png
keyboard_hook_error.png (12.56 KiB) Viewed 5505 times
I don't really mind the error, I'd just rather not be able to see it. After the first time the AV scans and says the file is okay, I don't receive this error message again. I did see this occurred throughout the years, for reference this is the latest version of AHK_H that I'm using. I was hoping of a way to just disable this message from popping up or a solution that actually resolves this issue. I don't mind either solution, just rather not have this error show in general.
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

27 Jun 2020, 20:36

If it's caused by your AV then add the file to exceptions. Doesn't seem to be a bug in ahk and disabling those errors is not a "fix". If you still want to disable them then I think there was a way, try checking the docs.
uhwok3n
Posts: 30
Joined: 15 May 2020, 23:08

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

27 Jun 2020, 21:49

kyuuuri wrote:
27 Jun 2020, 20:36
If it's caused by your AV then add the file to exceptions. Doesn't seem to be a bug in ahk and disabling those errors is not a "fix". If you still want to disable them then I think there was a way, try checking the docs.
I understand this is a part of AV, I just want the message to not appear. I don't care if the program breaks the first time it runs, I would just rather not have the autohotkey error message. I've tried going through the docs and can't find anything to remove this message. I've tried using #ErrorStdOut and even preventing the first run by creating a registry key that compares the current directory to the saved reg key

Code: Select all

currentDirectory := % A_ScriptDir
MsgBox, %currentDirectory%
SetRegView, 64
RegRead, fr1, HKCU, Software\whhyyyy, fr1
if (ErrorLevel) {
  RegWrite, REG_SZ, HKCU\Software\whhyyyy, fr1, %currentDirectory%
}
if (fr1 != currentDirectory) {
  RegWrite, REG_SZ, HKCU\Software\whhyyyy, fr1, %currentDirectory%
  ExitApp
}
This would work! buttt it is ran in autoexecute portion and I believe when it sees 'ExitApp' regardless of the block statement being true or not - it treats it as a return and ends the autoexecute portion when it is ran.
uhwok3n
Posts: 30
Joined: 15 May 2020, 23:08

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION  Topic is solved

27 Jun 2020, 22:37

I solved the issue, this code works if the file is placed in a different directory it does a soft run that just exits the app, the reason this didn't work before was because I had a try catch statement that was formatted incorrectly, if anyone has this issue in the future you can use this in auto execute close to the top:

Prevent first run AV message:

Code: Select all

;Prevent AV from showing AHK
currentDirectory := % A_ScriptDir
SetRegView, 64
RegRead, fr1, HKCU, Software\yourProgram, fr1
if (ErrorLevel) {
  RegWrite, REG_SZ, HKCU\Software\yourProgram, fr1, %currentDirectory%
  ExitApp
}
if (fr1 != currentDirectory) {
  RegWrite, REG_SZ, HKCU\Software\yourProgram, fr1, %currentDirectory%
  ExitApp
}
Change regview to your system(32/64). If anyone has a more direct solution, PLEASE let me know. Thanks!
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

28 Jun 2020, 09:46

uhwok3n wrote:
27 Jun 2020, 22:37
I solved the issue, this code works if the file is placed in a different directory it does a soft run that just exits the app, the reason this didn't work before was because I had a try catch statement that was formatted incorrectly, if anyone has this issue in the future you can use this in auto execute close to the top:

Prevent first run AV message:

Code: Select all

;Prevent AV from showing AHK
currentDirectory := % A_ScriptDir
SetRegView, 64
RegRead, fr1, HKCU, Software\yourProgram, fr1
if (ErrorLevel) {
  RegWrite, REG_SZ, HKCU\Software\yourProgram, fr1, %currentDirectory%
  ExitApp
}
if (fr1 != currentDirectory) {
  RegWrite, REG_SZ, HKCU\Software\yourProgram, fr1, %currentDirectory%
  ExitApp
}
Change regview to your system(32/64). If anyone has a more direct solution, PLEASE let me know. Thanks!
That's great to know, thank you for sharing the solution to your problem. I'm going to use this as well.
I still believe there is a way to hide those msgboxes but I don't remember how, I think I saw the code in a reply from HotKeyIt.
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

28 Jun 2020, 09:47

Found it! here it is: #WarnContinuableException Off
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

28 Jun 2020, 10:42

if you recompile with the latest AHK_H from github, you'll get an extra line in the error msgbox which points to the code that is causing it

kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

28 Jun 2020, 10:49

guest3456 wrote:
28 Jun 2020, 10:42
if you recompile with the latest AHK_H from github, you'll get an extra line in the error msgbox which points to the code that is causing it
Oh I didn't know that, that's very useful. Thank you for that, I will update asap.
uhwok3n
Posts: 30
Joined: 15 May 2020, 23:08

Re: Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

28 Jun 2020, 16:49

Well, I'll be damned, I downloaded it. I'm trying to figure out this dynamic password situation so I can kill 2 birds with 1 stone. After I compile, I'll see if it points to the problem so I can actually fix it and I'll update the solution here. Thank you to both of you. :)

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 46 guests