Solved

Access to shared printer is creating an exception (XP SP3)

Posted on 2008-06-17
7
384 Views
Last Modified: 2010-04-04
I am using in my software Printer.Handle & Printer to set some settings.
This worked till now fine.

After installing the SP3 of XP the program is crashing on some computers. This happens mostly when the standard printer is a shared network printer.
Printer is not nil, but when I try to access Printer.Handle or retrieve printer.pagewidth then the program is crashing.

Is there a way to find out whether the printer is a shared one?!
Or what could be the reason that there is no access to the handle.
0
Comment
Question by:Treppenmeister
  • 5
  • 2
7 Comments
 

Author Comment

by:Treppenmeister
ID: 21801894
I think that the name of a shared printer starts always with '\\' - so the half of my question is certainly answered.

I have to add still some information:
I access to the printer while the initialization.
If I set the printerindex to a non-shared printer then there is no crash and later I have normal access to the shared printer when I choose it after the initialization.

But what a difference does it make to have a non-shared printer and a shared printer?!
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 250 total points
ID: 21810085
For some printers the drivers are for certain service packs.
reinstall the printer driver after installing a service pack.

Usually the printer drivers get updated with the windows updates too.
with a manual install of a service pack the printers get overlooked sometimes.

Sometimes creating a printjob gives an error, but the printer automatically reinstalls it's driver.
Repeatedly calling the print job until ok is 1 solution



0
 

Author Comment

by:Treppenmeister
ID: 21810642
In one of the examples we have a network with two machines with SP3. On the one machine the program works fine, on the other machine it creates the axception.
The printer driver is not included in the SP but was installed seperately on the server and was installed on the clients automatically.  

I have at the moment a workaround: I am looking whether the name of the standard printer starts with '\\' and then I skip it till I find one with a 'good' name. But this cannot be the solution.

I have the problems only in the initialization process. Later I can access the shared network printers.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Treppenmeister
ID: 21810704
Very strange - today everything works fine (with the old program without the workaround).
I am not sure whether I should be now happy or not.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 21811240
Once you can get a printer to work, i keeps on working ...
until the next windows update
0
 

Author Comment

by:Treppenmeister
ID: 21872626
I cannot give you feedback yet since there was no time yet to reinstall SP3 on the one computer.
I would like  to verify it before I accept your answer as solution.
0
 

Author Comment

by:Treppenmeister
ID: 21972230
Re-installing the printer driver solved the problem.

Thanks for your help! 
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now