Previous Thread
Next Thread
Print Thread
Printing in Windows 2000 Pro #83 24 Feb 04 08:38 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
We have just installed our first Windows 2000 PC (all the others are on Windows 98) and all our applications are able to print except for Ashell.

When I try to print from Ashell, I get the following error:

A-Shell/32 Printer Error
Printer [\\vatexfs1\HP_Laser_5] not defined in WIN.INI

I get this error for all printers.

When I looked at WIN.INI, I noticed there is NO printer information, yet all my other applications are printing correctly (Word, Excel, other legacy programs, etc.) I'm not sure why.

Any ideas ??

Thanks, Ben

Re: Printing in Windows 2000 Pro #84 24 Feb 04 10:30 AM
Joined: Jun 2001
Posts: 11,650
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,650
The reference to WIN.INI here is a red herring. Historically, the locate printer API function did read the printer info from the WIN.INI, but since W95, it has actually been scanning the Registry. The actual text of the message is in SYS:ERRMSG.USA on line 003,021 and has been changed for quite some time; apparently you have an old copy of that message file, or an old copy of A-Shell.

In any case, to troubleshoot, the first step is use the TRACE LP feature, as follows:
Code
.SET TRACE LP ON
.PRINT <printer>=SYS:ERSATZ.INI
  
(It doesn't matter what you print, but ERSATZ.INI is a convenient file.)

This will display a bunch of trace lines, including the contents of the init file, and then lines that say "Comparing 'XXX' to 'YYY' and 'ZZZ'", where XXX is the printer name from the init file DEVICE statement, and YYY and ZZZ are the descriptive and hardware names of the printers from the Registry. This will probably make it clear what you need to change in your init file DEVICE statement.

Note that the DEVICE statement allows you to list two printer names. We recommend you enter the descriptive name and the network sharename, something like:
Code
DEVICE = Ben's Laser | \\vatexfs1\HP_Laser_5
 
Depending on the version of Windows and how the printer is defined to the workstation, one of the two names might not work, but the other would. For example, in some cases you cannot refer to your own printer via its sharename, in which case the descriptive name should work (provided of course that it matches the descriptive name shown in the printer properties.) In other cases, you may not be able to rename the descriptive name of network printers, in which case the sharename would work.

Note that the need for all this printer name redirection (which sometimes results in A-Shell being the only application that can't print) comes from the fact that AMOS printer names were limited to 6 characters. Having gotten tired of this limit, as of 4.7(833), A-Shell allows you to pass Windows-style printer names directly to the SPOOL.SBR, so you could do away with the init files entirely, providing your apps can print in the normal non-PASSTHROUGH mode like all other Windows apps. For example,
Code
XCALL SPOOL,FILE$,"\\vatexfs1\HP_Laser_5"
XCALL SPOOL,FILE$,"Ben's Laser"
 
The above technique, combined with XCALL MIAMEX,120 which prompts the user to select a printer from the standard Windows dialogs, would allow your app to select and use printers exactly like "normal Windows" programs do.

But if you need PASSTHROUGH mode (which is very non-Windows-like), you'll need to use an AMOS-style spooler name and a matching init file. Even then, as of 4.7(833), provided your version of Windows supports auto-detection/auto-configuring of network printers, you can just specify the \\machine\sharename in the DEVICE statement and A-Shell will not worry about whether it is defined to the local Registry. Instead, it will simply "open" the printer via the sharename. (Of course you'll still get an error if the printer doesn't exist or if your version of Windows does not support that, but it won't complain about it not being found in the Registry.)

Re: Printing in Windows 2000 Pro #85 24 Feb 04 08:04 PM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
Thanks, Jack. I'll try this when I get in tomorrow morning. I checked our A-Shell version, and it's 4.6(769).

Might this have something to do with the error ? Would upgrading to the latest version take care of the problem ?

Re: Printing in Windows 2000 Pro #86 24 Feb 04 08:29 PM
Joined: Jun 2001
Posts: 11,650
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,650
Yes, upgrading to 4.8 would probably resolve it without any further ado, since it would accept \\vatexfs1\HP_Laser_5 as a legal printer name without need for any confirmation of that in the Registry.

Re: Printing in Windows 2000 Pro #87 25 Feb 04 10:40 AM
A
Anonymous
Unregistered
Anonymous
Unregistered
A
FYI - I added the second name to all the .INI printer files (using my existing A-Shell software) and the problem disappeared...

Thanks for pointing me in the right direction !

...and I'll still upgrade as soon as I get a chance smile


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3