8-23-2012
for a 32-bit program
I set a breakpoint 2 instructions before the "CreateDC in WM_CREATE.
Then I single stepped(F5) 2 times to get to the call CreateDC.
Then I hit F6 to step over the call to CreateDC.
GoBug then threw up this message: "Sorry, cannot disassemble at present".
It should have stepped over the CreatDC call as I see it.
If I start GoBug over and set a breakpoint after the call to CreatDC
and single step to the call to GlobalUnlock. Then everything seems to
work fine.
.DATA
dwNeeded dd 0
dwReturned dd 0
pinfo4 dd 0
PrintCString db 96 DUP 0
WndProc:
FRAME hWnd,uMsg,wParam,lParam
USES ebx,edi,esi
Local hMemory,hdc,hdcPrn
; other code
.WM_CREATE
cmp D[uMsg],WM_CREATE
jne >>.WM_CHAR
push ebx
invoke EnumPrinters, PRINTER_ENUM_LOCAL,NULL,4,NULL,\
0,addr dwNeeded,addr dwReturned
invoke GlobalAlloc, GHND,[dwNeeded]
mov [hMemory], eax
invoke GlobalLock, eax
mov [pinfo4],eax
invoke EnumPrinters, PRINTER_ENUM_LOCAL,NULL,4,addr PrintCString,\
[dwNeeded],addr dwNeeded,addr dwReturned
mov ebx,addr PrintCString
mov edx, [ebx+PRINTER_INFO_4.pPrinterName]
; invoke CreateDC, NULL,addr PrintCString,NULL,NULL
invoke CreateDC, NULL,edx,NULL,NULL
mov [hdcPrn],eax
mov [hdc],eax
invoke GlobalUnlock, [hMemory]
invoke GlobalFree, [hMemory]
pop ebx
ret
; othercode
ENDF