The error is reported with my crash handler procedure, which is called by "OnErrorCall(@CrashHandler())". I also have error lines enabled for app so that the correct error line is reported, and it's the line for "DesktopWidth(0)".
Any ideas? The problem doesn't occur with this code, so I don't know why "DesktopWidth(0)" is crashing in my main app with this code.
Note: I do use threads in my app, and thread safety is enabled. But this procedure is NOT called as a thread.
Code: Select all
Global desktop_size_x, desktop_size_y, desktop_size_w, desktop_size_h
Procedure GetDesktopSize()
If ExamineDesktops() = 1
desktop_size_x = 0
desktop_size_y = 0
desktop_size_w = DesktopWidth(0) ; Illegal memory access.
desktop_size_h = DesktopHeight(0)
Else ; Irrelevant as only one monitor.
[...]
EndIf
EndProcedure