![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Getting the default printer in 64-bit Vista Hi, I have used the code below to return the default printer in 32-bit WinXP Pro, but now that I am running 64-bit Vista Business I'm getting an error: using System.Drawing.Printing; using (PrintDocument objPrintDocument = new PrintDocument()) { string strDefaultPrinter = objPrintDocument.PrinterSettings.PrinterName; } The error message is: "No printers are installed." and which seems to come from a method called HdevmodeInternal However, I have several printers installed, and the default printer is an old HP LaserJet 5. Does the above code not work on 64-bit Vista? The app in question is compiled for x86... Would I be better off using WMI to return the name of the default printer? I've tried to find a solution in Google and MSDN, but haven't had much luck... Any assistance gratefully received. -- http://www.markrae.net |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Getting the default printer in 64-bit Vista Hi Mark, You will ahve to get 64 bit drivers for your printer. Canon have the drivers so I would have to assume that HP would have too. "Mark Rae" wrote: > Hi, > > I have used the code below to return the default printer in 32-bit WinXP > Pro, but now that I am running 64-bit Vista Business I'm getting an error: > > using System.Drawing.Printing; > > using (PrintDocument objPrintDocument = new PrintDocument()) > { > string strDefaultPrinter = > objPrintDocument.PrinterSettings.PrinterName; > } > > The error message is: "No printers are installed." and which seems to come > from a method called HdevmodeInternal > > However, I have several printers installed, and the default printer is an > old HP LaserJet 5. > > Does the above code not work on 64-bit Vista? The app in question is > compiled for x86... > > Would I be better off using WMI to return the name of the default printer? > > I've tried to find a solution in Google and MSDN, but haven't had much > luck... > > Any assistance gratefully received. > > > -- > http://www.markrae.net > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Getting the default printer in 64-bit Vista "Bob" <Bob@discussions.microsoft.com> wrote in message news:87436CE8-9A78-479B-B542-51CC4E58FBF3@microsoft.com... > You will ahve to get 64 bit drivers for your printer. I'm obviously using 64-bit drivers... > so I would have to assume that HP would have too. They do... It's a known bug: http://connect.microsoft.com/VisualS...dbackID=242908 -- http://www.markrae.net |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Getting the default printer in 64-bit Vista Hmmm if that is the case it is very strange then "Mark Rae" wrote: > "Bob" <Bob@discussions.microsoft.com> wrote in message > news:87436CE8-9A78-479B-B542-51CC4E58FBF3@microsoft.com... > > > You will ahve to get 64 bit drivers for your printer. > > I'm obviously using 64-bit drivers... > > > so I would have to assume that HP would have too. > > They do... > > It's a known bug: > http://connect.microsoft.com/VisualS...dbackID=242908 > > > -- > http://www.markrae.net > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Getting the default printer in 64-bit Vista "Bob" <Bob@discussions.microsoft.com> wrote in message news:93AD65BC-2262-4B3B-B235-08251AF9E3BB@microsoft.com... > Hmmm if that is the case it is very strange then http://groups.google.com/group/micro...470f0e411259b3 -- http://www.markrae.net |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Vista - default printer doesn't stay as default | Vista print fax & scan | |||
| Setting a default printer for the DEFAULT USER | Vista print fax & scan | |||
| Vista Printer Default Printer Issues | Vista print fax & scan | |||
| Vista keeps stealing default status from default printer computer | Vista networking & sharing | |||
| Re: Anybody else's default printer not staying default? | Vista print fax & scan | |||