The InitDocStruct() function seems OK to me. So the problem probably is in the actual printing code you have.
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395
I'd say it should work as such.
So, the next step might be adding more error checking wherever applicable. I.e. verify that StartDoc/StartPage/EndDoc/EndPage return a value greater than zero, if not, use GetLastError() to get the error code. Also check that TextOut() is not returning FALSE .
[EDIT]
Since you seem to have trouble with the code tags, read http://www.daniweb.com/forums/misc-explaincode.html
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395
Well, you get this code with copy/paste from Miscrosoft support site:
http://support.microsoft.com/kb/139652
There is feedback form on this page - use it.
I think, it's not so interesting work to debug Microsoft official code examples on the forum...
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
Well, you get this code with copy/paste from Miscrosoft support site:
http://support.microsoft.com/kb/139652
So it seems to be ...I think, it's not so interesting work to debug Microsoft official code examples on the forum...
I would actually like to know what goes wrong with that piece of code, (especially considering it is a simple MSDN example)
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395