[win32/w2k] Annoying issue with wxPrintDialog, app crashes.

Platform win32

I was about to release an application, when I realized in last minutes
tests, wxPrintDialog could crash the application.

I do not know if it is a wxWidgets or wxPython issue and I really do
not know if it can be considered as an issue !

How to reproduce this (w2k)

1) In a wx app, open a wx.PrintDialog.
2) The dialog is displayed, and depending on the installed printers
various tabs are added to this dlg window.
3) Select one of these added tabs (*not* the first one).
4) [X] or Cancel button -> app crashes

Comments

- Python 2.5, w2k sp4, wxPython 2.8.3.0 .
- Python 2.5, w2k sp4, wxPython 2.6.3, same behaviour.
- No crash with the first tab (general).
- Same issue with wxPython demo.
- I toyed a lot. It seems it is impossible to catch the error with something
like (Python demo):

         if not printer.Print(self.frame, printout, True):
             wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK)
         else:
             self.printData = wx.PrintData( printer.GetPrintDialogData().GetPrintData() )
         printout.Destroy()

or

     wx.Printer_instance.GetLastError()= wx.PRINTER_ERROR

- When browsing the various wx*-lists, I did not find too much information.
- Test with various printers, including PDFCreator.
- On XP sp2, the wx.PrintDialog is not desplayed in the same way as on w2k,
only the "general" tab is displayed. Printer tuning is achieved through
an added button. XP does not suffer from this issue.

I'm aware w2k will soon or later be an "old timer". Anyway, it is still
alive.

Regards
Jean-Michel Fauth, Switzerland

···

cc: wx-users@lists.wxwindows.org

I was about to release an application, when I realized in last minutes
tests, wxPrintDialog could crash the application.

Without being able to reproduce this myself (it definitely doesn't crash
on my system) I can't really do anything but to ask you to build debugging
version of wxWidgets and run the application under (real, i.e. not Python)
debugger and send us the backtrace of the crash. Without this information I
really have no idea what's going on.

How to reproduce this (w2k)

1) In a wx app, open a wx.PrintDialog.
2) The dialog is displayed, and depending on the installed printers
various tabs are added to this dlg window.
3) Select one of these added tabs (*not* the first one).
4) or Cancel button -> app crashes

...

- Test with various printers, including PDFCreator.

This seems to indicate that this is not a printer driver issue... But
could this still be something specific to your system? Does it also crash
on another Win2k system?

I'm aware w2k will soon or later be an "old timer". Anyway, it is still
alive.

Yes, and we definitely should fix this bug if it's a wx problem. But, as I
said, it's impossible to do without knowing where does it crash.

Regards,
VZ

···

On Sun, 22 Apr 2007 18:10:36 +0200 jmf <jfauth@bluewin.ch> wrote: