+
+wxPrinterDC::wxPrinterDC(WXHDC theDC)
+{
+ m_isInteractive = FALSE;
+
+ m_hDC = theDC;
+ m_ok = TRUE;
+ if (m_hDC)
+ {
+ // int width = GetDeviceCaps(m_hDC, VERTRES);
+ // int height = GetDeviceCaps(m_hDC, HORZRES);
+ SetMapMode(wxMM_TEXT);
+ }
+ SetBrush(*wxBLACK_BRUSH);
+ SetPen(*wxBLACK_PEN);
+}
+
+wxPrinterDC::~wxPrinterDC(void)
+{
+}
+
+bool wxPrinterDC::StartDoc(const wxString& message)
+{
+ DOCINFO docinfo;
+ docinfo.cbSize = sizeof(DOCINFO);
+ docinfo.lpszDocName = (const char *)message;
+
+ wxString filename(m_printData.GetFilename());
+
+ if (filename.IsEmpty())
+ docinfo.lpszOutput = NULL;
+ else
+ docinfo.lpszOutput = (const char *) filename;
+
+#if defined(__WIN95__)
+ docinfo.lpszDatatype = NULL;
+ docinfo.fwType = 0;
+#endif
+
+ if (!m_hDC)
+ return FALSE;
+
+ int ret =
+#ifndef __WIN32__
+ ::StartDoc((HDC) m_hDC, &docinfo);
+#else
+#ifdef UNICODE
+ ::StartDocW((HDC) m_hDC, &docinfo);
+#else
+#ifdef __TWIN32__
+ ::StartDoc((HDC) m_hDC, &docinfo);
+#else
+ ::StartDocA((HDC) m_hDC, &docinfo);
+#endif
+#endif
+#endif
+
+#ifndef __WIN16__
+ if (ret <= 0)
+ {
+ DWORD lastError = GetLastError();
+ wxLogDebug("wxDC::StartDoc failed with error: %d\n", lastError);
+ }