Autohotkey-Scripts icon indicating copy to clipboard operation
Autohotkey-Scripts copied to clipboard

[Error] WatchDirectory.ahk

Open superuser7777 opened this issue 3 years ago • 0 comments

This is exactly the function I was looking for. Thank you for your wonderful work.

I got an error when running with the latest version of AHK. Do you know the cause? +Start OK +An error occurs when a change is detected

Win10 Pro : latest AHK : AutoHotkey v1.1.34.03 U64

---------------------------
Critical Error:  Invalid memory read/write.

	Line#
	047: Return
	048: r += 1
	049: CurrentFolder := Dir%r%Path
	050: PointerFNI := &Dir%r%FNI
	051: DllCall( "GetOverlappedResult", UInt, hDir, UInt, &Dir%r%Overlapped, UIntP, nReadLen, Int, true )  
	052: Loop
	052: {
--->	053: pNext := NumGet( PointerFNI + 0  )
	054: Action := NumGet( PointerFNI + 4  )
	055: FileNameLen := NumGet( PointerFNI + 8  )
	056: pFileName := ( PointerFNI + 12 )
	057: if (Action < 0x6)  
	057: {
	058: VarSetCapacity( FileNameANSI, FileNameLen )  
	059: DllCall( "WideCharToMultiByte",UInt,0,UInt,0,UInt,pFileName,UInt,FileNameLen,Str,FileNameANSI,UInt,FileNameLen,UInt,0,UInt,0)  

The program is now unstable and will exit.
---------------------------
OK   
---------------------------

superuser7777 avatar Jul 15 '22 16:07 superuser7777