#ifndef WX_PRECOMP
#endif
-#include "wx/dcprint.h"
+#include "wx/string.h"
#include "wx/log.h"
+#include "wx/window.h"
+#include "wx/msw/private.h"
+#include "wx/dcprint.h"
#include "math.h"
-#include <windows.h>
-
-#if wxUSE_COMMON_DIALOGS
+#if wxUSE_COMMON_DIALOGS || defined(__WXWINE__)
#include <commdlg.h>
#endif
#include <print.h>
#endif
-#ifdef DrawText
-#undef DrawText
-#endif
-
-#ifdef GetCharWidth
-#undef GetCharWidth
-#endif
-
-#ifdef StartDoc
-#undef StartDoc
-#endif
-
#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
#endif
{
m_isInteractive = interactive;
- if (!file.IsNull() && file != "")
+ if (!file.IsNull() && file != wxT(""))
m_printData.SetFilename(file);
#if wxUSE_COMMON_DIALOGS
}
else
#endif
- if ((!driver_name.IsNull() && driver_name != "") &&
- (!device_name.IsNull() && device_name != "") &&
- (!file.IsNull() && file != ""))
+ if ((!driver_name.IsNull() && driver_name != wxT("")) &&
+ (!device_name.IsNull() && device_name != wxT("")) &&
+ (!file.IsNull() && file != wxT("")))
{
- m_hDC = (WXHDC) CreateDC((char *) (const char *) driver_name, (char *) (const char *) device_name, (char *) (const char *) file, NULL);
+ m_hDC = (WXHDC) CreateDC(WXSTRINGCAST driver_name, WXSTRINGCAST device_name, WXSTRINGCAST file, NULL);
m_ok = m_hDC ? TRUE: FALSE;
}
else
{
DOCINFO docinfo;
docinfo.cbSize = sizeof(DOCINFO);
- docinfo.lpszDocName = (const char *)message;
+ docinfo.lpszDocName = (const wxChar*)message;
wxString filename(m_printData.GetFilename());
if (filename.IsEmpty())
docinfo.lpszOutput = NULL;
else
- docinfo.lpszOutput = (const char *) filename;
+ docinfo.lpszOutput = (const wxChar *) filename;
#if defined(__WIN95__)
docinfo.lpszDatatype = NULL;
if (ret <= 0)
{
DWORD lastError = GetLastError();
- wxLogDebug("wxDC::StartDoc failed with error: %d\n", lastError);
+ wxLogDebug(wxT("wxDC::StartDoc failed with error: %d\n"), lastError);
}
#endif
GlobalFree(pd.hDevMode);
pd.hDevMode=NULL;
}
- return ( deviceName != "" );
+ return ( deviceName != wxT("") );
}
#if 0
wxPrintData printData = printDataConst;
printData.ConvertToNative();
- char* driverName = (char*) NULL;
+ wxChar* driverName = (wxChar*) NULL;
wxString devNameStr = printData.GetPrinterName();
- char* deviceName;
- char* portName = (char*) NULL; // Obsolete in WIN32
+ wxChar* deviceName;
+ wxChar* portName = (wxChar*) NULL; // Obsolete in WIN32
- if (devNameStr == "")
- deviceName = (char*) NULL;
+ if (devNameStr == wxT(""))
+ deviceName = (wxChar*) NULL;
else
- deviceName = (char*) (const char*) devNameStr;
+ deviceName = WXSTRINGCAST devNameStr;
LPDEVMODE lpDevMode = (LPDEVMODE) NULL;
- HGLOBAL hDevMode = (HGLOBAL) printData.GetNativeData();
+ HGLOBAL hDevMode = (HGLOBAL)(DWORD) printData.GetNativeData();
if ( hDevMode )
lpDevMode = (DEVMODE*) GlobalLock(hDevMode);
- if (devNameStr == "")
+ if (devNameStr == wxT(""))
{
// Retrieve the default device name
wxString portName;
bool ret = wxGetDefaultDeviceName(devNameStr, portName);
- wxASSERT_MSG( ret, "Could not get default device name." );
+ wxASSERT_MSG( ret, wxT("Could not get default device name.") );
- deviceName = (char*) (const char*) devNameStr;
+ deviceName = WXSTRINGCAST devNameStr;
}
#ifdef __WIN32__