Thanks all for the help.
The previous items in WM_CREATE seem to check out fine now.
However the program is still not printing.
I have included a snippet of the code that might be in error.
Of course it could be something else.
.data
PT2 db '01020207010302040105020602030208',0
db '01010103020501070208010402060106',0
db '01040102010102060207010802010105',0
saveebx dd 0
holdR db " ",0
DOCINFOA <sizeof(DOCINFOA),AppName,NULL,NULL,0>
; other code
WndProc:
FRAME hWnd,iMsg,wParam,lParam
USES ebx,edi,esi
Local hdcPrn
; other code
invoke StartDoc, [hdcPrn],addr doci
lea ebx,PT2
mov [saveebx],ebx ; address PT2 in saveebx
; other code
mov ebx, [saveebx] ; address in ebx
; not sure if ebx should have " []" or not in invoke
invoke WriteToPrinter, [hdcPrn],393,660,1045,ebx
; other code
WriteToPrinter FRAME hdcPrn,Horz1,Horz2,Vert4,LpBuffer
; Have no idea which of the following two instructions are correct
mov ecx,addr LpBuffer ; address in LpBuffer of PT2
mov ecx,[LpBuffer] ; address in LpBuffer of PT2
;This line is causing the problem - address in ecx should move data to ax
;Have a messagebox here and the program boombs after it.
mov ax,W[ecx]
cmp al,030h
jne >
mov al,020h
:
mov W[holdR],ax
invoke TextOutA, [hdcPrn],[Horz1],[Vert4],[holdR],2
ret
ENDF