I can not reproduce this error.
If I had not seen the screenshot I would have said this is absolutely not possible due to "IfWinExist,ahk_id %MDPID%"
Code: Select all
ShowGui:
IfWinExist,ahk_id %MDPID%
{
WinActivate, ahk_id %MDPID%
return
}
;this is a sample gui
Gui 1: Add, Radio, vAssociatedVariable1, 1st Sample Radio button
Gui 1: Add, Radio, vAssociatedVariable2, 2nd Sample Radio button
Gui 1: Add, Radio, vAssociatedVariable3, 3rd Sample Radio button
Gui 1: show, autosize, Autohotkey Window
WinGet, MDPID , ID, Autohotkey Window
return
When he got this error, I tried "Gui 1: destroy" instead of "IfWinExist,ahk_id %MDPID%" so that the window, if it existed, would be destroyed before trying to show it again. He still got this error.
I verified the id MDPID is correct.
The associated variable is used only 1 time in my entire script
There are no labels between the label ShowGui and the return after Gui 1: show, which would allow a goto or gosub to bypass the "IfWinExist,ahk_id %MDPID%" or "Gui 1: destroy"
There are no if statements like
Code: Select all
if Var1 = 0
Gui 1: Add, Radio, vAssociatedVariable1, Sample Radio button
if Var1 = 1
Gui 1: Add, Radio, vAssociatedVariable1, Another Sample Radio button
Just completely makes no sense that the Gui 1: destroy before showing the Gui did not fix the issue. Could maybe the 1st associated variable was trying to be used before Gui 1: destroy could finish destroying the window. But that does not explain why "IfWinExist,ahk_id %MDPID%" allowed an attempt to create the 1st associated variable a second time, or it skipping the first 2 associated variables and erroring on the 3rd.
Also, this error is intermittent.
I have at least 50 people using this script. He is the only one having this issue.
I have not posted this script on the Autohotkey forum.
My script is over 5500 lines. The complete script is here https://sourceforge.net/projects/networkawareprinting/files/AutohotkeyDotCom/NetworkAwarePrinting.ahk/download
The EXE and AHK files are here https://sourceforge.net/projects/networkawareprinting/files/
The ahk can be run by itself but the "Check For Updates" will not work. The exe allows for updating the script, by downloading files from source forge.
Just want to add this information in case anyone downloads the ahk and attempts to run it.
Please give me suggestions on what is causing this.
Thanks
Datalife