AHK doesn't report a Sharing Violation error
Posted: 11 May 2021, 18:20
Hi,
Here's the topic where this bug was discovered (mikeyww considers it as a bug, hence this topic) : https://www.autohotkey.com/boards/viewtopic.php?f=76&t=90319
Here's the precise post where this bug was identified : https://www.autohotkey.com/boards/viewtopic.php?p=399236#p399236
How to reproduce it :
If we forget a FileVar.close() before the Gui Add command, then the command will fail : the picture won't be displayed, but AHK won't report any error, when there is in fact one, that Visual Studio in debug mode would report :
Here's the topic where this bug was discovered (mikeyww considers it as a bug, hence this topic) : https://www.autohotkey.com/boards/viewtopic.php?f=76&t=90319
Here's the precise post where this bug was identified : https://www.autohotkey.com/boards/viewtopic.php?p=399236#p399236
How to reproduce it :
Code: Select all
ImgPath := path\to\a\picture
FileVar := FileOpen(ImgPath, "r")
Gui Add, Picture, , % ImgPath
Gui, Show
We had a bit of trouble finding this one, so I hope it can be corrected in a future AHK release. Thanks in advance !ERROR_SHARING_VIOLATION
32 (0x20)
The process cannot access the file because it is being used by another process.