wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_name, const wxString& file, bool interactive, int orientation)
{
m_isInteractive = interactive;
wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_name, const wxString& file, bool interactive, int orientation)
{
m_isInteractive = interactive;
pd.lStructSize = sizeof( PRINTDLG );
pd.hwndOwner=(HWND) NULL;
pd.hDevMode=(HANDLE)NULL;
pd.lStructSize = sizeof( PRINTDLG );
pd.hwndOwner=(HWND) NULL;
pd.hDevMode=(HANDLE)NULL;
lpDevNames = (LPDEVNAMES)GlobalLock(pd.hDevNames);
lpszDriverName = (LPSTR)lpDevNames + lpDevNames->wDriverOffset;
lpszDeviceName = (LPSTR)lpDevNames + lpDevNames->wDeviceOffset;
lpszPortName = (LPSTR)lpDevNames + lpDevNames->wOutputOffset;
GlobalUnlock(pd.hDevNames);
lpDevNames = (LPDEVNAMES)GlobalLock(pd.hDevNames);
lpszDriverName = (LPSTR)lpDevNames + lpDevNames->wDriverOffset;
lpszDeviceName = (LPSTR)lpDevNames + lpDevNames->wDeviceOffset;
lpszPortName = (LPSTR)lpDevNames + lpDevNames->wOutputOffset;
GlobalUnlock(pd.hDevNames);
if ( pd.hDevMode )
{
lpDevMode = (DEVMODE*) GlobalLock(pd.hDevMode);
lpDevMode->dmOrientation = orientation;
lpDevMode->dmFields |= DM_ORIENTATION;
}
if ( pd.hDevMode )
{
lpDevMode = (DEVMODE*) GlobalLock(pd.hDevMode);
lpDevMode->dmOrientation = orientation;
lpDevMode->dmFields |= DM_ORIENTATION;
}
#ifdef __WIN32__
hDC = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, (DEVMODE *)lpDevMode);
#else
hDC = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, (LPSTR)lpDevMode);
#endif
#ifdef __WIN32__
hDC = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, (DEVMODE *)lpDevMode);
#else
hDC = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, (LPSTR)lpDevMode);
#endif
wxString devNameStr = printData.GetPrinterName();
wxChar* deviceName;
wxChar* portName = (wxChar*) NULL; // Obsolete in WIN32
wxString devNameStr = printData.GetPrinterName();
wxChar* deviceName;
wxChar* portName = (wxChar*) NULL; // Obsolete in WIN32
wxASSERT_MSG( ret, wxT("Could not get default device name.") );
deviceName = WXSTRINGCAST devNameStr;
}
wxASSERT_MSG( ret, wxT("Could not get default device name.") );
deviceName = WXSTRINGCAST devNameStr;
}
#ifdef __WIN32__
HDC hDC = CreateDC(driverName, deviceName, portName, (DEVMODE *) lpDevMode);
#else
HDC hDC = CreateDC(driverName, deviceName, portName, (LPSTR) lpDevMode);
#endif
#ifdef __WIN32__
HDC hDC = CreateDC(driverName, deviceName, portName, (DEVMODE *) lpDevMode);
#else
HDC hDC = CreateDC(driverName, deviceName, portName, (LPSTR) lpDevMode);
#endif