#513 RexxUtil::SysWinSetDefaultPrinter() is incorrect

3.3.0
closed
Mark Miesfeld
5
2012-08-14
2008-06-29
Mark Miesfeld
No

The current implementation of SysWinSetDefaultPrinter is not correct for Windows 2000, or any later OS. The code looks like it should only work on Windows NT, but may work on Windows 98, etc.. But, it is not the documented method for setting the default printer on Windows ME, 98, or 95.

The code looks like someone may have started to make an attempt to detect the current OS, but that was never carried through. I'll fix the code so that it detects the current OS and works properly on W2k and later. I'll also fix the code so that if an earlier OS is detectd it follows the documented way to set the default printer on NT. If that works on earlier OSes then fine, but I'm not going to test it or support it for earlier OSes.

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2008-06-29

    Logged In: YES
    user_id=191588
    Originator: YES

    Committed revision 2610.

    It turns out that the existing code was just using the wrong return code, indicating error when there was not an error.

    However, the method used to set the default printer was out of date. I updated the code to use the documented method for W2K or later, allowing the user to just specify the printer name. And also maintained the existing printer string format of: "Printername,Drivername,Portname"

     


Anonymous


Cancel   Add attachments