Date: Tue, 25 Nov 1997 08:42:41 -0500
Reply-To: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
Sender: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
From: Gilles Plante <sittel@IBM.NET>
Organization: SITTEL
Subject: Re: Using SysCreateObjects with Printers
Content-Type: text/plain; charset=us-ascii
Simon Ellis wrote:
>
> I'm attempting to use the following code to create a printer icon on
> an OS/2 2.11 LAN server and the second piece to create an icon on a
> machine using the server's shared printer.
> However, only the icon is being created, when you click on it you have
> to enter all the printer details, which is not very helpful.
> Any suggestions would be greatly appreciated.
> Cheers, Simon.
>
> /*Server code*/
> call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
> call SysLoadFuncs
>
> Title = "Printer"
> Class = "WPPrinter"
> Setup = "QUEUENAME=Printer2;QSTARTTIME=00:00;" ||,
> "QSTOPTIME=00:00;APPDEFAULT=NO;" ||,
> "PRINTSPECIFICFORMAT=NO;PRINTWHILSPOOLING=YES;" ||,
> "PRINTDRIVER=IBM42XX.IBM 4207 Proprinter X24E;" ||,
> "QUEUEDRIVER=PMPRINT;OUTPUTTOFILE=NO;PORTNAME=LPT1;" ||,
> "JOBDIALOGBEFOREPRINT=NO;TITLE=Printer;NOPRINT=YES;" ||,
> "HIDEBUTTON=DEFAULT;MINWIN=DEFAULT;CCVIEW=DEFAULT;" ||,
> "DEFAULTVIEW=DEFAULT;"
> Location = "<WP_DESKTOP>"
>
> call SysCreateObject class ,,
> title ,,
>
> location ,,
>
> setup ,,
>
> /*end of server code*/
>
> /*Workstation Code */
> call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
> call SysLoadFuncs
>
> Title = "Printer"
> Class = "WPRPrinter"
> Setup = "NETID=LS\PRIMARY\PRINTER2;QUEUENAME=PRINTER2;" ||,
> "QSTARTTIME=00:00;QSTOPTIME=00:00;APPDEFAULT=NO;" ||,
> "PRINTSPECIFICFORMAT=NO;PRINTWHILSPOOLING=NO;" ||,
> "PRINTDRIVER=IBM42XX.IBM 4207 Proprinter X24E;" ||,
> "QUEUEDRIVER=PMPRINT;JOBDIALOGBEFOREPRINT=NO;" ||,
> "TITLE=Printer;NOPRINT=YES;HIDEBUTTON=DEFAULT;" ||,
> "MINWIN=DEFAULT;CCVIEW=DEFAULT;DEFAULTVIEW=DEFAULT;"
> Location = "<WP_DESKTOP>"
>
> call SysCreateObject class ,,
> title ,,
> location ,,
> setup ,,
>
> /*end of workstation code*/
Creating printers can be very frustating: the slight syntax error and
the orinter is not correctly created (if created...). A few hints:
a) you can create printers in Rexx only starting with OS/2 Warp 3.0. It
looks you are running OS/2 2.11...
b) on the client side, please note that there is an error with NETID. It
should be:
LS:\\PRIMARY\PRINTER2
c) if it fails, be sure to delete the icon before running again the Rexx
program.
Hope this helps. Give me some more details if it does not.
--
Gilles Plante, ing.
Les Microsystemes Sittel Ltee
2073 Branly, Sainte-Foy, Quebec, Canada, G1N 4C7
Tel:(418)682-0286 -- sittel@ibm.net
|