home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3534 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.3 KB  |  62 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!lotus!lotus.com!robertk
  3. From: robertk@rkrajewski.lotus.com (Robert Krajewski)
  4. Subject: Re: Printing using the new Windows 3.1 API
  5. In-Reply-To: Peter.Hug@bbs.actrix.gen.nz's message of Wed, 18 Nov 1992 01:20:02 GMT
  6. Message-ID: <ROBERTK.92Nov18161718@rkrajewski.lotus.com>
  7. Sender: news@lotus.com
  8. Organization: Lotus Development Corporation
  9. References: <1992Nov18.012002.983@actrix.gen.nz>
  10. Date: 18 Nov 92 16:17:18
  11. Lines: 49
  12.  
  13. In article <1992Nov18.012002.983@actrix.gen.nz> Peter.Hug@bbs.actrix.gen.nz writes:
  14.  
  15.    From: Peter.Hug@bbs.actrix.gen.nz
  16.    Organization: Actrix Information Exchange
  17.    Date: Wed, 18 Nov 1992 01:20:02 GMT
  18.    Sender: Peter.Hug@actrix.gen.nz (Peter Hug)
  19.  
  20.    I have two problems with printing under Windows 3.1:
  21.  
  22.    1. Are there situations when an application must use "banding" for printing
  23.       or is this something an application can descide if it wants to make use of
  24.       this feature. If it is required with some printer drivers, how can this be 
  25.       determined?
  26.  
  27. If you don't code for banding, Windows will do the banding itself.
  28. This works, but might be a little slow or memory-hungry when imaging
  29. large pages to "dumb" printers.
  30.  
  31.    2. When using "banding", the sequence of printer functions I invoke is:
  32.  
  33.       StartDoc(...);
  34.       while( more pages )
  35.      {
  36.      StartPage(...);
  37.      Escape(..., NEXTBAND, paintRectangle, ....);
  38.      while(!IsEmptyRect(paintRectangle))
  39.         {
  40.         paintBand(..., paintRectangle );
  41.         Escape(..., NEXTBAND, paintRectangle, ....);
  42.         }
  43.      EndPage(...);
  44.      }
  45.       EndDoc(...);
  46.  
  47.       Unfortunately, EndPage() always returns SB_ERROR! Is there a cure? If I
  48.       dont use banding, everything works just fine!
  49.  
  50. I beleive that the EndPage is not needed. The 3.1 documentation for
  51. NEXTBAND says you shouldn't use NEXTFRAME (now EndPage) after it.
  52.  
  53. Otherwise, your code looks fine. If the printer doesn't support
  54. banding, then you'll just get one band, the entire page.
  55.  
  56. If you don't band yourself, Windows has to create a temporary page
  57. image, and then send the whole thing down at once. This might cause
  58. problems if you are low on memory. In fact, while the type of printer
  59. affects whether you get more than one band, it's also possible to see
  60. more bands in the loop you wrote above just by decreasing the amount
  61. of available memory !
  62.