wxMac: html/printing sample crashes
Stefan Csomor
csomor at advancedconcepts.ch
Fri Nov 3 20:55:41 PST 2006
Hi Robert
> In CVS HEAD, wxHtmlEasyPrinting crashes during printing. If
> you build the html/printing sample and try to print, after
> you click OK in the print dialog, the program crashes. The
> stack frame is, in part:
>
> #0 0x001552d8 in wxDC::ComputeScaleAndOrigin at dcgraph.cpp:312
> #1 0x00155100 in wxDC::SetUserScale at dcgraph.cpp:265
> #2 0x000982ee in wxHtmlPrintout::OnPreparePrinting at
> htmprint.cpp:203
> #3 0x001ca999 in wxMacPrinter::Print at printmac.cpp:389
> #4 0x0018310f in wxPrinter::Print at prntbase.cpp:378
> #5 0x00099e7c in wxHtmlEasyPrinting::DoPrint at htmprint.cpp:594
> #6 0x00099a80 in wxHtmlEasyPrinting::PrintFile at htmprint.cpp:549
> #7 0x000051ed in MyFrame::OnPrint at printing.cpp:241
> #
> The offending call is
>
> m_matrixCurrent = m_graphicContext->CreateMatrix();
>
> This faults because m_graphicContext is still NULL at this point.
>
> I'm still getting to know the wxGCDC drawing, so I couldn't
> tell where m_graphicContext should have been initialized. Can
> you offer any guidance?
because there is no native context on OSX at that moment of printing
(only when a page really gets printed there is one) I'll have to add
something similar to the situation with the windowref, to have an affine
transform that gets setup even if there is no context yet.
Thanks,
Stefan
More information about the wx-users
mailing list