Announcement

Collapse
No announcement yet.

Printing in Windows XP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing in Windows XP

    I have a application that has been working for 15 years now.
    We just switched over our code to PB3.5 from QB. There have
    been no issues with printing to date running under DOS or Win98.
    We have upgraded a few of our users to WinXP and there now is a
    printing issue.
    When printing anything from the application there is about a 20
    second delay before the printer starts to print. This delay was
    not in DOS or Win98. I've tried it on 3 different XP machines
    all with the same results. The application uses your basic
    Open "LPT1:" for output as #1. There are no printer drivers
    installed in any of the machines DOS/Win98/XP. The printer
    is a basic Dot Matrix type.


    Any suggestions appreciated
    Walter


    ------------------

  • #2
    Even if there are no print drivers installed, xp still has the
    print spooler. It's setup to receive a minimum number of
    characters or wait for a particular amunt of time before it
    starts printing.

    Play with the print spooler setting in control panel and see if
    you can disable or shorten the pause time. You may have to
    install a generic printer driver to do this but...
    ------------------


    [This message has been edited by Mel Bishop (edited July 23, 2003).]
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      I forgot to add, before we switched over to PB3.5 we were
      using QB. The verson compiled with QB and running under XP
      did not have a delay...

      ------------------

      Comment


      • #4
        Importantly, XP virtualizes the hardware so both PB and QB executables still have to work within that layer, so there will likely be some slowdown .

        For example, instead of using OPEN "LPT1:" (which uses the PB/DOS parallel port driver to directly control the port), try using OPEN "LPT1" (which sends the data via the BIOS instead).

        Yet another way is to write the data to a disk file, then use SHELL "COPY /B file.prn LPT1 > NUL"

        And yet, tey another way might be to use DOSPRINT from www.print.com



        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          <http://www.resortdata.com/Customers/Knowledge/KB-DOS/K000036.htm>
          The above site describes the problem and the soulution.

          I had the same delay from a PBdos program on my XP laptop. I made the
          changes as described above and saw a dramatic increase in the printout
          starting time.

          The site shows how to decrease the time delay from 15 seconds to 3 seconds.

          Hope this helps.

          John Tate

          ------------------

          Comment


          • #6
            I've found a solution to slow printing of DOS programs in XP.
            It will take the 30 second delay and reduce it to 2 seconds.

            1. click Start ->Run ->then type REGEDT32
            2. bring up HKEY_LOCAL_MACHINE
            3. expand to ->System ->CurrentControlSet ->Control ->WOW
            4. now in the right pane there should be a key "LPT_Timeout".
            Double click this key
            5. change the 15 to 1
            6. close and reset machine



            ------------------

            Comment


            • #7
              Another thing you might try is Control Panel|Printers. Right Click
              on the printer and select Properties|Advanced|Print directly to the printer.
              That by-passes the spooler all together.

              OR

              if you prefer:

              HKLM\CurrentControlSet\Control\Printers\<the printer name>\DsSpooler\

              printSpooling = PrintDirect

              [This message has been edited by John McWilliams (edited August 12, 2003).]

              Comment


              • #8
                Code:
                FUNCTION PBMAIN&
                   'This is instantaneous in PB/CC and PDS 7.1 with XP Pro
                   'to a laser printer.
                   'Checked the registry and timeout is 15
                   'Not using printing direct option either
                  filehandle& = FREEFILE
                  OPEN "LPT1:" FOR OUTPUT AS #FileHandle&
                  lin$ = CHR$(12)
                  PRINT #FileHandle&, Lin$
                  CLOSE #FileHandle&
                END FUNCTION
                'My XP Pro machine doesn't have a local key
                'HKLM\CurrentControlSet\Control\Printers
                ------------------




                [This message has been edited by Mike Doty (edited August 12, 2003).]
                How long is an idea? Write it down.

                Comment


                • #9
                  'My XP Pro machine doesn't have a local key
                  'HKLM\CurrentControlSet\Control\Printers
                  Intresting, As I have only NT4 and W2K to test against. Thanks
                  for that info.

                  Comment


                  • #10
                    Originally posted by Mike Doty:
                    'My XP Pro machine doesn't have a local key
                    'HKLM\CurrentControlSet\Control\Printers
                    Try this instead:
                    HKLM\System\CurrentControlSet\Control\Printers

                    You forgot the "System".


                    ------------------
                    -Bob
                    -Bob

                    Comment


                    • #11
                      NB: The following comment does <U>not</U> apply to PB/DOS programs:

                      Per the PB/CC code above, you will find that "LPT1:" is not actually the correct name for a device in Win32, so for improved reliability I would suggest using the plain "LPT1" device name instead.

                      ------------------
                      Lance
                      PowerBASIC Support
                      mailto:[email protected][email protected]</A>
                      Lance
                      mailto:[email protected]

                      Comment

                      Working...
                      X