#513 RexxUtil::SysWinSetDefaultPrinter() is incorrect

Mark Miesfeld
Mark Miesfeld

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.


  • Mark Miesfeld
    Mark Miesfeld

    Logged In: YES
    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"



Cancel   Add attachments