X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b6a582bef796b43ad4cf0a96bd40bfd631460c6..713129f9d34e3027d2be46b134d2f4c490ad145f:/src/msw/printdlg.cpp?ds=sidebyside diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index f2b04942b7..37bdfd3aba 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -46,6 +46,8 @@ // wxWindowsPrintNativeData //---------------------------------------------------------------------------- +#if wxDEBUG_LEVEL + static wxString wxGetPrintDlgError() { DWORD err = CommDlgExtendedError(); @@ -79,6 +81,9 @@ static wxString wxGetPrintDlgError() return msg; } +#endif // wxDEBUG_LEVEL + + static HGLOBAL wxCreateDevNames(const wxString& driverName, const wxString& printerName, @@ -364,7 +369,9 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) pd.hDevMode = NULL; pd.hDevNames = NULL; +#if wxDEBUG_LEVEL wxLogDebug(wxT("Printing error: ") + wxGetPrintDlgError()); +#endif // wxDEBUG_LEVEL } else { @@ -450,6 +457,15 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) devMode->dmPaperLength = (short)(paperSize.y * 10); devMode->dmFields |= DM_PAPERWIDTH; devMode->dmFields |= DM_PAPERLENGTH; + + // A printer driver may or may not also want DM_PAPERSIZE to + // be specified. Also, if the printer driver doesn't implement the DMPAPER_USER + // size, then this won't work, and even if you found the correct id by + // enumerating the driver's paper sizes, it probably won't change the actual size, + // it'll just select that custom paper type with its own current setting. + // For a discussion on this, see http://www.codeguru.com/forum/showthread.php?threadid=458617 + // Although m_customWindowsPaperId is intended to work around this, it's + // unclear how it can help you set the custom paper size programmatically. } //else: neither paper type nor size specified, don't fill DEVMODE // at all so that the system defaults are used