Printers and Vista, program hangs or chrashs.
-
Is anyone else having problems with Vista printer drivers and there .Net application? My program hangs when the print preview control is initialised. If I try to catch the problem in a catch{} try block it often fails with a memory error at the next line of code. I am assuming the users buy a new PC, Vista installed, and then hook up to there trusty network or locally attached 5 year old printers. I can't reproduce these problems at home so I am a bit lost. I found this link which explains where some of the problems may start: [^] Thanks Stuart
-
Is anyone else having problems with Vista printer drivers and there .Net application? My program hangs when the print preview control is initialised. If I try to catch the problem in a catch{} try block it often fails with a memory error at the next line of code. I am assuming the users buy a new PC, Vista installed, and then hook up to there trusty network or locally attached 5 year old printers. I can't reproduce these problems at home so I am a bit lost. I found this link which explains where some of the problems may start: [^] Thanks Stuart
-
new PC, Vista installed, and then hook up to there trusty network or locally attached 5 year old printers. you 2gb ram use
Yes the PC has3.5 gb of ram. The printer causing problems is an HP and the drivers are uptodate. OS Version: 6.0.6001.65536 Service Pack 1 Workstation x86 .NET Framework version: 2.0.50727.3074 x86 Processor: 2x "AMD Athlon(tm) 64 X2 Dual Core Processor 3800+" @ ~2004MHz (DEP, SSE, SSE2, SSE3) Physical memory: 3453 MB I've asked the user to try Paint.Net Stuart
-
Is anyone else having problems with Vista printer drivers and there .Net application? My program hangs when the print preview control is initialised. If I try to catch the problem in a catch{} try block it often fails with a memory error at the next line of code. I am assuming the users buy a new PC, Vista installed, and then hook up to there trusty network or locally attached 5 year old printers. I can't reproduce these problems at home so I am a bit lost. I found this link which explains where some of the problems may start: [^] Thanks Stuart
Write a simple program that doesn't do anything but display the print preview form, and send it to the user. If THAT program crashes, it's on the user's end. If it doesn't, you've got faulty code that is probably somehow connected to what you're printing. I assume you know that the same code that prints is also the code used to provide the previewed printout.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Write a simple program that doesn't do anything but display the print preview form, and send it to the user. If THAT program crashes, it's on the user's end. If it doesn't, you've got faulty code that is probably somehow connected to what you're printing. I assume you know that the same code that prints is also the code used to provide the previewed printout.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Thanks John. Thats a good idea. One user has installed pdfcreator and now can print to pdf and then on to their printer but still can't print directly from my app. I have a smaller app that use an RTF control that supports printing so I'll send them a copy for testing. The error messages I get when my program crashes point to memory corruption by the driver. Here is one example: Exception details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Drawing.SafeNativeMethods.PrintDlg(PRINTDLGX86 lppd) at System.Drawing.Printing.PrinterSettings.GetOutputPort() at System.Drawing.Printing.PrinterSettings.FastDeviceCapabilities(Int16 capability, IntPtr pointerToBuffer, Int32 defaultValue, String printerName) at System.Drawing.Printing.PrinterSettings.Get_PaperSizes() at System.Drawing.Printing.PageSettings.PaperSizeFromMode(DEVMODE mode) at System.Drawing.Printing.PageSettings.GetPaperSize(IntPtr modeHandle) at System.Drawing.Printing.PageSettings.GetBounds(IntPtr modeHandle) at System.Drawing.Printing.PrintController.CreatePrintPageEvent(PageSettings pageSettings) at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at System.Windows.Forms.PrintPreviewControl.ComputePreview() Here is what happened when I tried to cath the error in a Try Catch block. In the Catch I am trying to display the exception contents in a MessageBox ) Exception details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.RuntimeTypeHandle.ConstructName(Boolean nameSpace, Boolean fullInst, Boolean assembly) at System.RuntimeType.RuntimeTypeCache.ConstructName(String& name, Boolean nameSpace, Boolean fullinst, Boolean assembly) at System.RuntimeType.get_Name() at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat) at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Exception.get_StackTrace() at System.Exception.ToString() at DrawTools.Startup.Main(String[] args) Thanks Stuart
-
Thanks John. Thats a good idea. One user has installed pdfcreator and now can print to pdf and then on to their printer but still can't print directly from my app. I have a smaller app that use an RTF control that supports printing so I'll send them a copy for testing. The error messages I get when my program crashes point to memory corruption by the driver. Here is one example: Exception details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Drawing.SafeNativeMethods.PrintDlg(PRINTDLGX86 lppd) at System.Drawing.Printing.PrinterSettings.GetOutputPort() at System.Drawing.Printing.PrinterSettings.FastDeviceCapabilities(Int16 capability, IntPtr pointerToBuffer, Int32 defaultValue, String printerName) at System.Drawing.Printing.PrinterSettings.Get_PaperSizes() at System.Drawing.Printing.PageSettings.PaperSizeFromMode(DEVMODE mode) at System.Drawing.Printing.PageSettings.GetPaperSize(IntPtr modeHandle) at System.Drawing.Printing.PageSettings.GetBounds(IntPtr modeHandle) at System.Drawing.Printing.PrintController.CreatePrintPageEvent(PageSettings pageSettings) at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at System.Windows.Forms.PrintPreviewControl.ComputePreview() Here is what happened when I tried to cath the error in a Try Catch block. In the Catch I am trying to display the exception contents in a MessageBox ) Exception details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.RuntimeTypeHandle.ConstructName(Boolean nameSpace, Boolean fullInst, Boolean assembly) at System.RuntimeType.RuntimeTypeCache.ConstructName(String& name, Boolean nameSpace, Boolean fullinst, Boolean assembly) at System.RuntimeType.get_Name() at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat) at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) at System.Exception.get_StackTrace() at System.Exception.ToString() at DrawTools.Startup.Main(String[] args) Thanks Stuart
Make sure their OS and their .Net framework is fully patched up. Oh yeah, and make sure they're using the latest OS-compatible video drivers.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Make sure their OS and their .Net framework is fully patched up. Oh yeah, and make sure they're using the latest OS-compatible video drivers.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001From: Member 4312265 I'm am having the exact same problem with printing. Same two errors and everything. Did you find a solution? Christian Christian, I have not made any progress. I can't reproduce the problem here and so I'm relying on my users. PDFCREATOR gets them out of trouble. (use it as the default printer, it creates a pdf an then you can print the pdf fine.) Do you have the problem on a development PC ? If so I could send you a test program and we could work on this together. Things I have tried: Make sure .net and OS are fully patched. Remove all code optimisation from my release build. Place all print functions in TRY blocks to prevent the program from chrashing. regards Stuart PS You can download my application at http://www.mapsoft.com.au (miniCAD V5)