473,385 Members | 2,003 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,385 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 2131
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.