/////////////////////////////////////////////////////////////////////////////
-// Name: printdlg.cpp
+// Name: src/msw/printdlg.cpp
// Purpose: wxPrintDialog, wxPageSetupDialog
// Author: Julian Smart
// Modified by:
// headers
// ---------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "printdlg.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
#ifndef WX_PRECOMP
+ #include "wx/msw/wrapcdlg.h"
#include "wx/app.h"
+ #include "wx/dcprint.h"
+ #include "wx/cmndata.h"
#endif
-#include "wx/cmndata.h"
#include "wx/printdlg.h"
#include "wx/msw/printdlg.h"
-#include "wx/dcprint.h"
#include "wx/paper.h"
#include <stdlib.h>
-#include "wx/msw/wrapcdlg.h"
-
#ifndef __WIN32__
#include <print.h>
#endif
else
{
hDev = GlobalAlloc(GPTR, 4*sizeof(WORD)+
- ( driverName.Length() + 1 +
- printerName.Length() + 1 +
- portName.Length()+1 ) * sizeof(wxChar) );
+ ( driverName.length() + 1 +
+ printerName.length() + 1 +
+ portName.length()+1 ) * sizeof(wxChar) );
LPDEVNAMES lpDev = (LPDEVNAMES)GlobalLock(hDev);
lpDev->wDriverOffset = sizeof(WORD) * 4 / sizeof(wxChar);
wxStrcpy((wxChar*)lpDev + lpDev->wDriverOffset, driverName);
lpDev->wDeviceOffset = (WORD)( lpDev->wDriverOffset +
- driverName.Length() + 1 );
+ driverName.length() + 1 );
wxStrcpy((wxChar*)lpDev + lpDev->wDeviceOffset, printerName);
lpDev->wOutputOffset = (WORD)( lpDev->wDeviceOffset +
- printerName.Length() + 1 );
+ printerName.length() + 1 );
wxStrcpy((wxChar*)lpDev + lpDev->wOutputOffset, portName);
lpDev->wDefault = 0;
GlobalFree(hDevNames);
}
-bool wxWindowsPrintNativeData::Ok() const
+bool wxWindowsPrintNativeData::IsOk() const
{
return (m_devMode != NULL) ;
}
//// 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)