const wxString& device_name,
const wxString& file,
bool interactive,
- int orientation)
+ wxPrintOrientation orientation)
{
m_isInteractive = interactive;
{
if ( !driver_name.empty() && !device_name.empty() && !file.empty() )
{
- m_hDC = (WXHDC) CreateDC(driver_name.wx_str(),
- device_name.wx_str(),
+ m_hDC = (WXHDC) CreateDC(driver_name.t_str(),
+ device_name.t_str(),
file.fn_str(),
NULL);
}
{
DOCINFO docinfo;
docinfo.cbSize = sizeof(DOCINFO);
- docinfo.lpszDocName = message.wx_str();
+ docinfo.lpszDocName = message.t_str();
wxString filename(m_printData.GetFilename());
if (filename.empty())
docinfo.lpszOutput = NULL;
else
- docinfo.lpszOutput = filename.wx_str();
+ docinfo.lpszOutput = filename.t_str();
docinfo.lpszDatatype = NULL;
docinfo.fwType = 0;
}
-wxRect wxPrinterDCImpl::GetPaperRect()
+wxRect wxPrinterDCImpl::GetPaperRect() const
{
if (!IsOk()) return wxRect(0, 0, 0, 0);
}
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
+ GlobalPtrLock lockDevMode;
+ const HGLOBAL devMode = data->GetDevMode();
+ if ( devMode )
+ lockDevMode.Init(devMode);
- DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
-
- HDC hDC = ::CreateDC(NULL, deviceName.wx_str(), NULL, lpDevMode);
+ HDC hDC = ::CreateDC
+ (
+ NULL, // no driver name as we use device name
+ deviceName.t_str(),
+ NULL, // unused
+ static_cast<DEVMODE *>(lockDevMode.Get())
+ );
if ( !hDC )
- wxLogLastError(_T("CreateDC(printer)"));
-
- if ( lpDevMode )
- ::GlobalUnlock(hDevMode);
+ {
+ wxLogLastError(wxT("CreateDC(printer)"));
+ }
return (WXHDC) hDC;
#endif // PostScript/Windows printing
DIBSECTION ds;
if ( !::GetObject(dib.GetHandle(), sizeof(ds), &ds) )
{
- wxLogLastError(_T("GetObject(DIBSECTION)"));
+ wxLogLastError(wxT("GetObject(DIBSECTION)"));
return false;
}
wxCoord x, wxCoord y,
bool useMask)
{
- wxCHECK_RET( bmp.Ok(), _T("invalid bitmap in wxPrinterDC::DrawBitmap") );
+ wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
int width = bmp.GetWidth(),
height = bmp.GetHeight();
wxCoord width, wxCoord height,
wxDC *source,
wxCoord WXUNUSED(xsrc), wxCoord WXUNUSED(ysrc),
- int WXUNUSED(rop), bool useMask,
+ wxRasterOperationMode WXUNUSED(rop), bool useMask,
wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask))
{
wxDCImpl *impl = source->GetImpl();