Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

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

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
Treppenmeister
Asked:
Treppenmeister
  • 5
  • 2
1 Solution
 
TreppenmeisterAuthor Commented:
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
 
Geert GruwezOracle dbaCommented:
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
 
TreppenmeisterAuthor Commented:
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
Independent Software Vendors: 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!

 
TreppenmeisterAuthor Commented:
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
 
Geert GruwezOracle dbaCommented:
Once you can get a printer to work, i keeps on working ...
until the next windows update
0
 
TreppenmeisterAuthor Commented:
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
 
TreppenmeisterAuthor Commented:
Re-installing the printer driver solved the problem.

Thanks for your help! 
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now