473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem printing in Win98

Hi

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')
Curiously, that instruction does works on Win2K/XP, but trying to use
this shortcut for easy printing in Win98 provokes such error. I've
tried in different machines (all of them running with Win98) and I
obtain the same output.

Does anybody knows what happens with Win98 printing automation?
Any idea?

Thanks in advance

Nov 22 '05 #1
7 2132
According to MSDN, err code 31 from ShellExecute is SE_ERR_NOASSOC,
meaning there's not an application registered for printing that file type.

Roger

"Maravilloso" <ma*********@gmail.com> wrote in message news:11**********************@z14g2000cwz.googlegr oups.com...
Hi

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')
Curiously, that instruction does works on Win2K/XP, but trying to use
this shortcut for easy printing in Win98 provokes such error. I've
tried in different machines (all of them running with Win98) and I
obtain the same output.

Does anybody knows what happens with Win98 printing automation?
Any idea?

Thanks in advance


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 22 '05 #2
According to MSDN, err code 31 from ShellExecute is SE_ERR_NOASSOC,
meaning there's not an application registered for printing that file type.

Roger

"Maravilloso" <ma*********@gmail.com> wrote in message news:11**********************@z14g2000cwz.googlegr oups.com...
Hi

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')
Curiously, that instruction does works on Win2K/XP, but trying to use
this shortcut for easy printing in Win98 provokes such error. I've
tried in different machines (all of them running with Win98) and I
obtain the same output.

Does anybody knows what happens with Win98 printing automation?
Any idea?

Thanks in advance


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 22 '05 #3
"Maravilloso" <ma*********@gmail.com> wrote:

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')


Roger is correct. In order to print a .ps file, you have to have installed
an application that handles .ps files. You have probably installed
GhostScript on your 2K/XP box. If you install it on your Win98 box, your
ShellExecute should work.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 22 '05 #4
"Maravilloso" <ma*********@gmail.com> wrote:

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')


Roger is correct. In order to print a .ps file, you have to have installed
an application that handles .ps files. You have probably installed
GhostScript on your 2K/XP box. If you install it on your Win98 box, your
ShellExecute should work.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 22 '05 #5
Maravilloso wrote:
Hi

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')
Curiously, that instruction does works on Win2K/XP, but trying to use
this shortcut for easy printing in Win98 provokes such error. I've
tried in different machines (all of them running with Win98) and I
obtain the same output.

Does anybody knows what happens with Win98 printing automation?
Any idea?

Thanks in advance


I presume this .ps file is a preformed postscript file that should be sent
to a postscript printer without further modification?

In this case, I think you should use copy instead of print. Something like
this:

win32api.ShellExecute(0, "copy", "file.ps prn", None, ".", 0)

It has been a long time since I used Windows, especially 98, but if 'prn'
doesn't work, you might try one of: 'lpt', 'lpt1', 'lpt:', 'lpt1:'.
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk

Nov 22 '05 #6
Maravilloso wrote:
Hi

I'm trying to automatically send a postscript file to be printed to the
default printer in a Win98 PC, by means of using the instrucction:

win32api.ShellExecute (0, "print", "file.ps", None, ".", 0)

but it raises an exception with the message:

error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')
Curiously, that instruction does works on Win2K/XP, but trying to use
this shortcut for easy printing in Win98 provokes such error. I've
tried in different machines (all of them running with Win98) and I
obtain the same output.

Does anybody knows what happens with Win98 printing automation?
Any idea?

Thanks in advance


I presume this .ps file is a preformed postscript file that should be sent
to a postscript printer without further modification?

In this case, I think you should use copy instead of print. Something like
this:

win32api.ShellExecute(0, "copy", "file.ps prn", None, ".", 0)

It has been a long time since I used Windows, especially 98, but if 'prn'
doesn't work, you might try one of: 'lpt', 'lpt1', 'lpt:', 'lpt1:'.
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk

Nov 22 '05 #7
Dale Strickland-Clark <da**@riverhall.nospam.co.uk> wrote:

I presume this .ps file is a preformed postscript file that should be sent
to a postscript printer without further modification?

In this case, I think you should use copy instead of print. Something like
this:

win32api.ShellExecute(0, "copy", "file.ps prn", None, ".", 0)


No, that's not how ShellExecute works. ShellExecute looks up the handler
for the file in the third parameter, based on its extension, and then looks
for the handler for the appropriate "verb" in the second parameter. It's
just registry magic. It's not a command line thing.

Most file types have an "open" verb and a "print" verb; some also have
"edit".
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Darcy Kahle | last post by:
I am trying to do some advanced printing in python using the win32ui module, and have run into an issue. I need to print a page landscape. As I could not determine how to specify the orientation...
12
by: Richard Hanson | last post by:
Over the last few days, I reinstalled Win2kSP2 to a spare harddrive I had just swapped into my Fujitsu LifeBook P1120 (long story <wink>). Subsequently, I DL'ed the newest Python alpha (2.4a2), and...
19
by: dcrespo | last post by:
Hi all... Is there a way to print a PDF file directly from Python without having Acrobat installed? I know about ReportLab. It's a python module that lets you create almost any PDF document, but I...
1
by: Brian Sabolik | last post by:
After developing my entire applications around printing via the Crystal Decisions engine in .net, I was shocked to find out that a report that printed fine in Adobe 5.0 reader now prints garbled...
5
by: rd | last post by:
Has anyone else noticed a problem when printing html with fieldsets in them? Whenever I print even the simplest document with a fieldset, the amount of data sent to the printer jumps from a few K...
2
by: Eddie | last post by:
When I use “IP Helper API’s functions” In my program, all is ok. until I run it on Windows 98. On Windows Xp everything is ok. On 98 I get an error: MsgBox: File MyApp.exe is
5
by: C-Services Holland b.v. | last post by:
Hi all, I've run into a problem trying to print from vb.net (2002) in Windows 98. To test it I've setup a single form with a button and the following code: 'the form has a button called...
0
by: Maravilloso | last post by:
Hi I'm trying to automatically send a postscript file to be printed to the default printer in a Win98 PC, by means of using the instrucction: win32api.ShellExecute (0, "print", "file.ps",...
2
by: tool | last post by:
I'm having a problem that I'm not sure of the source for... so I'm asking here as the Apache group doesnt seem to know anything about the error message Apache generates. The error message is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.