Solved

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

Posted on 2008-06-17
7
392 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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