Applied patch [ 1345297 ] Crash with MSW wxPrintDialog when pressed OK.
authorJulian Smart <julian@anthemion.co.uk>
Tue, 17 Jan 2006 09:53:14 +0000 (09:53 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 17 Jan 2006 09:53:14 +0000 (09:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/printdlg.cpp

index cde8522461d91596022f4f0fdf0d2bee6669153b..33e9028994c5f783b0fdbabe4e85b822e39cbfbf 100644 (file)
@@ -202,7 +202,8 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
 
         //// Printer name
         if (devMode->dmDeviceName[0] != 0)
-            data.SetPrinterName( devMode->dmDeviceName );
+            // This syntax fixes a crash when using VS 7.1
+            data.SetPrinterName( wxString(devMode->dmDeviceName, CCHDEVICENAME) );
 
         //// Colour
         if (devMode->dmFields & DM_COLOR)