News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Strange behavior of StartDoc

Started by untio, March 08, 2011, 04:05:55 PM

Previous topic - Next topic

untio

Hi,
I have coded a litle windows project. It simply shows a gregorian calendar. Now I have just finished the printing feature. I have got three printers. When I print the calendar using:

local docinf:DOCINFO
mov eax, sizeof DOCINFO
mov docinf.cbSize, eax
mov docinf.lpszDocName, offset docname
mov docinf.lpszOutput, NULL
mov docinf.lpszDatatype, NULL
mov docinf.fwType, 0
invoke StartDoc, printerhdc, addr docinf
cmp eax, 1
jnl paso1
ret

It prints ok in all my printers. But when I use:

local docinf:DOCINFO
mov eax, sizeof DOCINFO
mov docinf.cbSize, eax
mov docinf.lpszDocName, offset docname
mov docinf.lpszOutput, NULL
mov docinf.lpszDatatype, NULL
mov docinf.fwType, 0
invoke StartDocW, printerhdc, addr docinf
cmp eax, 1
jnl paso1
ret

changing 'docname' to a string of words, seems that the printing job is not sent to one of my printers (hp laserjet 1018). I must say that I reinstalled the driver and the problem may be inside the driver, but why fails this code and the previous one works perfect. I use Windows XP SP 3.

Thanks in advance.