For the attached debug version, I get this sequence on Win10:Line 1798: Handle non valido.
Line 1804: Handle non valido.
Line 1828: Handle non valido.
Line 1849: Handle non valido.
Line 1930: Handle non valido.
Line 1968: Handle non valido.
Line 1997: Handle non valido.
Line 1998: Handle non valido.
Line 2005: Handle non valido.
EDIT: NEW VERSION, the old one was not working. Check CreateCompatibleDC in stuff.inc, it seems to fail for the hBufferDC section:
** this is line 1636 hBufferDC **
** this is line 1636 hPreBufferDC **
** this is line 1636 hManDC **
** this is line 1636 LoadBitmap **
** this is line 1636 hManCrashDC **
** this is line 1637 after mCreateDC **
Unfortunately, this is in an external module, stuff.inc, so the macro cannot know the exact line. Both MASM and UAsm do not provide correct @Line when such things hang around in include files. Better to integrate them into the main source... I know C/C++ programmers are being taught to split everything in tiny little modules, but a) that was good advice when computers were really slow, b) it makes debugging very difficult, and c) it's not good advice if your editor has bookmarks and a powerful little listbox ;-)
Attached a version trying to guess the exact line with the ShowThisLine macro. No extra code generated, it's just echos.
P.S.: Just saw this:
Print Str$("withinPixel: hBufferDC=%i\n", hBufferDC)
inc gDebugCt ; <<<< needed for the versions that work