From 2fd284a4a09793c29078296529d3e9db5acd0a0f Mon Sep 17 00:00:00 2001
From: Julian Smart <julian@anthemion.co.uk>
Date: Sat, 16 Jan 1999 22:17:13 +0000
Subject: [PATCH] For wxMSW, split XPM handler into separate file (please add
 handler explicitly in app); doc changes espec. wxBitmap overview

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 distrib/msw/vc.rsp        |   9 +-
 docs/latex/wx/app.tex     |   4 +-
 docs/latex/wx/bitmap.tex  |  13 +-
 docs/latex/wx/icon.tex    | 106 ++---
 docs/latex/wx/tbitmap.tex | 147 ++++--
 docs/latex/wx/tdelwin.tex |   5 +-
 docs/motif/todo.txt       |   2 +
 include/wx/msw/bitmap.h   |   4 +-
 include/wx/msw/pnghand.h  |   6 +
 include/wx/msw/setup.h    |   2 +-
 include/wx/msw/xpmhand.h  |  51 ++
 include/wx/xpmhand.h      |  11 +
 samples/makefile.nt       |  74 +--
 samples/png/pngdemo.cpp   |   3 +
 src/msw/bitmap.cpp        | 190 +-------
 src/msw/cursor.cpp        |   5 -
 src/msw/icon.cpp          |   5 -
 src/msw/makefile.b32      |   1 +
 src/msw/makefile.bcc      |   1 +
 src/msw/makefile.dos      |   4 +
 src/msw/makefile.g95      |   3 +-
 src/msw/makefile.nt       | 175 +------
 src/msw/makefile.sc       |   3 +-
 src/msw/makefile.sl       | 954 ++++++++++++++++++++++++++++++++++++++
 src/msw/makefile.wat      |   4 +
 src/msw/xpmhand.cpp       | 182 ++++++++
 src/ntwxwin.mak           |   2 +-
 src/xpm/makefile.nt       | 170 +++++++
 28 files changed, 1641 insertions(+), 495 deletions(-)
 create mode 100644 include/wx/msw/xpmhand.h
 create mode 100644 include/wx/xpmhand.h
 create mode 100644 src/msw/makefile.sl
 create mode 100644 src/msw/xpmhand.cpp
 create mode 100644 src/xpm/makefile.nt

diff --git a/distrib/msw/vc.rsp b/distrib/msw/vc.rsp
index 630b084712..6900ebc7da 100644
--- a/distrib/msw/vc.rsp
+++ b/distrib/msw/vc.rsp
@@ -115,8 +115,8 @@ samples/typetest/TypetestVC.dsw
 samples/validate/ValidateVC.dsp
 samples/validate/ValidateVC.dsw
 
-samples/wxsocket/SocketVC.dsp
-samples/wxsocket/SocketVC.dsw
+samples/wxsocket/ClientVC.dsp
+samples/wxsocket/ServerVC.dsw
 
 samples/wxpoem/PoemVC.dsp
 samples/wxpoem/PoemVC.dsw
@@ -129,12 +129,17 @@ utils/wxprop/src/PropSampleVC.dsw
 utils/dialoged/src/DialogEdVC.dsp
 utils/dialoged/src/DialogEdVC.dsw
 
+utils/tex2rtf/src/Tex2RTFVC.dsp
+utils/tex2rtf/src/Tex2RTFVC.dsw
+
 utils/glcanvas/win/GlcanvasVC.dsp
 utils/glcanvas/win/GlcanvasVC.dsw
 utils/glcanvas/samples/cube/CubeVC.dsp
 utils/glcanvas/samples/cube/CubeVC.dsw
 utils/glcanvas/samples/isosurf/IsosurfVC.dsp
 utils/glcanvas/samples/isosurf/IsosurfVC.dsw
+utils/glcanvas/samples/penguin/PenguinVC.dsp
+utils/glcanvas/samples/penguin/PenguinVC.dsw
 
 utils/ogl/src/OglVC.dsp
 utils/ogl/src/OglVC.dsw
diff --git a/docs/latex/wx/app.tex b/docs/latex/wx/app.tex
index bd02e31db8..495ee3f4c0 100644
--- a/docs/latex/wx/app.tex
+++ b/docs/latex/wx/app.tex
@@ -30,15 +30,13 @@ a reference to your application object) to be visible to other files.
 
 \membersection{wxApp::wxApp}
 
-\func{void}{wxApp}{\param{int}{ language = wxLANGUAGE\_ENGLISH}}
+\func{void}{wxApp}{\void}
 
 Constructor. Called implicitly with a definition of a wxApp object.
 
 The argument is a language identifier; this is an experimental
 feature and will be expanded and documented in future versions.
 
-TODO: completely rewrite the language stuff.
-
 \membersection{wxApp::\destruct{wxApp}}
 
 \func{void}{\destruct{wxApp}}{\void}
diff --git a/docs/latex/wx/bitmap.tex b/docs/latex/wx/bitmap.tex
index f847a82bf0..7ebd366272 100644
--- a/docs/latex/wx/bitmap.tex
+++ b/docs/latex/wx/bitmap.tex
@@ -12,7 +12,11 @@ either monochrome or colour.
 
 \wxheading{See also}
 
-\helpref{wxBitmap overview}{wxbitmapoverview}, \helpref{wxDC::Blit}{wxdcblit}, \helpref{wxIcon}{wxicon}, \helpref{wxCursor}{wxcursor}, \helpref{wxMemoryDC}{wxmemorydc}
+\helpref{wxBitmap overview}{wxbitmapoverview}, 
+\helpref{supported bitmap file formats}{supportedbitmapformats}, 
+\helpref{wxDC::Blit}{wxdcblit}, 
+\helpref{wxIcon}{wxicon}, \helpref{wxCursor}{wxcursor}, \helpref{wxBitmap}{wxbitmap}, 
+\helpref{wxMemoryDC}{wxmemorydc}
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
@@ -74,8 +78,9 @@ Its meaning is determined by the {\it type} parameter.}
 \end{twocollist}
 
 The validity of these flags depends on the platform and wxWindows configuration.
-If all possible wxWindows settings are used, the Windows platform supports BMP, BMP\_RESOURCE,
-XPM\_DATA, and XPM. Under X, the available formats are BMP, GIF, XBM, and XPM.}
+If all possible wxWindows settings are used, the Windows platform supports BMP file, BMP resource,
+XPM data, and XPM. Under wxGTK, the available formats are BMP file, XPM data, XPM file, and PNG file.
+Under wxMotif, the available formats are XBM data, XBM file, XPM data, XPM file.}
 
 \wxheading{Remarks}
 
@@ -113,7 +118,7 @@ The eighth form constructs a bitmap from a file or resource. {\it name} can refe
 to a resource name under MS Windows, or a filename under MS Windows and X.
 
 Under Windows, {\it type} defaults to wxBITMAP\_TYPE\_BMP\_RESOURCE.
-Under X, {\it type} defaults to wxBITMAP\_TYPE\_XBM.
+Under X, {\it type} defaults to wxBITMAP\_TYPE\_XPM.
 
 \wxheading{See also}
 
diff --git a/docs/latex/wx/icon.tex b/docs/latex/wx/icon.tex
index fdc9efd9af..c374790965 100644
--- a/docs/latex/wx/icon.tex
+++ b/docs/latex/wx/icon.tex
@@ -1,41 +1,32 @@
 \section{\class{wxIcon}}\label{wxicon}
 
 An icon is a small rectangular bitmap usually used for denoting a
-minimized application.
+minimized application. It differs from a wxBitmap in always
+having a mask associated with it for transparent drawing. On some platforms,
+icons and bitmaps are implemented identically, since there is no real distinction between
+a wxBitmap with a mask and an icon; and there is no specific icon format on
+some platforms (X-based applications usually standardize on XPMs for small bitmaps
+and icons). However, some platforms (such as Windows) make the distinction, so
+a separate class is provided.
 
 \wxheading{Remarks}
 
-It is optional (but desirable) to associate a
-pertinent icon with a frame. Obviously icons in X and MS Windows are
-created in a different manner, and colour icons in X are difficult
-to arrange. Therefore, separate icons will be created for the different
+It is usually desirable to associate a pertinent icon with a frame. Icons
+can also be used for other purposes, for example with \helpref{wxTreeCtrl}{wxtreectrl} 
+and \helpref{wxListCtrl}{wxlistctrl}.
+
+Icons have different formats on different platforms.
+Therefore, separate icons will usually be created for the different
 environments.  Platform-specific methods for creating a {\bf wxIcon}\rtfsp
 structure are catered for, and this is an occasion where conditional
 compilation will probably be required.
 
 Note that a new icon must be created for every time the icon is to be
-used for a new window. In X, this will ensure that fresh X resources
-are allocated for this frame. In MS Windows, the icon will not be
+used for a new window. In Windows, the icon will not be
 reloaded if it has already been used. An icon allocated to a frame will
 be deleted when the frame is deleted.
 
-The following shows the conditional compilation required to define an
-icon in X and in MS Windows. The alternative is to use the string
-version of the icon constructor, which loads a file under X and a
-resource under MS Windows, but has the disadvantage of requiring the
-X icon file to be available at run-time.
-
-\begin{verbatim}
-#ifdef wx_x
-#include "aiai.xbm"
-#endif
-#ifdef wx_msw
-  wxIcon *icon = new wxIcon("aiai");
-#endif
-#ifdef wx_x
-  wxIcon *icon = new wxIcon(aiai_bits, aiai_width, aiai_height);
-#endif
-\end{verbatim}
+For more information please see \helpref{Bitmap and icon overview}{wxbitmapoverview}.
 
 \wxheading{Derived from}
 
@@ -45,7 +36,8 @@ X icon file to be available at run-time.
 
 \wxheading{See also}
 
-\helpref{wxIcon overview}{wxiconoverview}, \helpref{wxDC::DrawIcon}{wxdcdrawicon}, \helpref{wxCursor}{wxcursor}
+\helpref{Bitmap and icon overview}{wxbitmapoverview}, \helpref{supported bitmap file formats}{supportedbitmapformats}, 
+\helpref{wxDC::DrawIcon}{wxdcdrawicon}, \helpref{wxCursor}{wxcursor}
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
@@ -116,8 +108,9 @@ Its meaning is determined by the {\it flags} parameter.}
 \end{twocollist}
 
 The validity of these flags depends on the platform and wxWindows configuration.
-If all possible wxWindows settings are used, the Windows platform supports ICO, ICO\_RESOURCE,
-XPM\_DATA, and XPM. Under X, the available formats are BMP, GIF, XBM, and XPM.}
+If all possible wxWindows settings are used, the Windows platform supports ICO file, ICO resource,
+XPM data, and XPM file. Under wxGTK, the available formats are BMP file, XPM data, XPM file, and PNG file.
+Under wxMotif, the available formats are XBM data, XBM file, XPM data, XPM file.}
 
 \wxheading{Remarks}
 
@@ -151,11 +144,28 @@ of character pointers called mybitmap:
 wxIcon *icon = new wxIcon(mybitmap);
 \end{verbatim}
 
+A macro, wxICON, is available which creates an icon using an XPM
+on the appropriate platform, or an icon resource on Windows.
+
+\begin{verbatim}
+wxIcon icon(wxICON(mondrian));
+
+// Equivalent to:
+
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
+wxIcon icon(mondrian_xpm);
+#endif
+
+#if defined(__WXMSW__)
+wxIcon icon("mondrian");
+#endif
+\end{verbatim}
+
 The eighth form constructs an icon from a file or resource. {\it name} can refer
 to a resource name under MS Windows, or a filename under MS Windows and X.
 
 Under Windows, {\it type} defaults to wxBITMAP\_TYPE\_ICO\_RESOURCE.
-Under X, {\it type} defaults to wxBITMAP\_TYPE\_XBM.
+Under X, {\it type} defaults to wxBITMAP\_TYPE\_XPM.
 
 \wxheading{See also}
 
@@ -175,46 +185,6 @@ destroyed automatically by wxWindows when the application exits.
 
 Do not delete an icon that is selected into a memory device context.
 
-\begin{comment}
-\membersection{wxIcon::Create}\label{wxiconcreate}
-
-\func{virtual bool}{Create}{\param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
-
-Creates a fresh icon. If the final argument is omitted, the display depth of
-the screen is used.
-
-\func{virtual bool}{Create}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
-
-Creates an icon from the given data, which can be of arbitrary type.
-
-\wxheading{Parameters}
-
-\docparam{width}{The width of the icon in pixels.}
-
-\docparam{height}{The height of the icon in pixels.}
-
-\docparam{depth}{The depth of the icon in pixels. If this is -1, the screen depth is used.}
-
-\docparam{data}{Data whose type depends on the value of {\it type}.}
-
-\docparam{type}{An icon type identifier - see \helpref{wxIcon::wxIcon}{wxiconconstr} for a list
-of possible values.}
-
-\wxheading{Return value}
-
-TRUE if the call succeeded, FALSE otherwise.
-
-\wxheading{Remarks}
-
-The first form works on all platforms. The portability of the second form depends on the
-type of data.
-
-\wxheading{See also}
-
-\helpref{wxIcon::wxIcon}{wxiconconstr}
-
-\end{comment}
-
 \membersection{wxIcon::GetDepth}
 
 \constfunc{int}{GetDepth}{\void}
diff --git a/docs/latex/wx/tbitmap.tex b/docs/latex/wx/tbitmap.tex
index 01cd32aae7..bb9fa8717e 100644
--- a/docs/latex/wx/tbitmap.tex
+++ b/docs/latex/wx/tbitmap.tex
@@ -1,4 +1,4 @@
-\section{Bitmaps overview}\label{wxbitmapoverview}
+\section{Bitmaps and icons overview}\label{wxbitmapoverview}
 
 Classes: \helpref{wxBitmap}{wxbitmap}, \helpref{wxBitmapHandler}{wxbitmaphandler}, \helpref{wxIcon}{wxicon}, \helpref{wxCursor}{wxcursor}.
 
@@ -19,40 +19,120 @@ version of the graphic which appears on the main window.
 See \helpref{wxMemoryDC}{wxmemorydc} for an example of drawing onto a bitmap.
 
 The following shows the conditional compilation required to load a
-bitmap in X and in Windows 3. The alternative is to use the string
-version of the bitmap constructor, which loads a file under X and a
-resource under Windows 3, but has the disadvantage of requiring the
-X icon file to be available at run-time.
+bitmap under Unix and in Windows. The alternative is to use the string
+version of the bitmap constructor, which loads a file under Unix and a
+resource or file under Windows, but has the disadvantage of requiring the
+XPM icon file to be available at run-time.
 
 \begin{verbatim}
-#ifdef wx_x
-#include "aiai.xbm"
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#include "mondrian.xpm"
 #endif
-#ifdef wx_msw
-  wxIcon *icon = new wxBitmap("aiai");
+\end{verbatim}
+
+A macro, wxICON, is available which creates an icon using an XPM
+on the appropriate platform, or an icon resource on Windows.
+
+\begin{verbatim}
+wxIcon icon(wxICON(mondrian));
+
+// Equivalent to:
+
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
+wxIcon icon(mondrian_xpm);
 #endif
-#ifdef wx_x
-  wxIcon *icon = new wxBitmap(aiai_bits, aiai_width, aiai_height);
+
+#if defined(__WXMSW__)
+wxIcon icon("mondrian");
 #endif
 \end{verbatim}
 
-\subsection{Loading bitmaps: further information}
+\subsection{Supported bitmap file formats}\label{supportedbitmapformats}
+
+The following lists the formats handled on different platforms. Note
+that missing or partially-implemented formats can be supplemented
+by using \helpref{wxImage}{wximage} to load the data, and then converting
+it to wxBitmap form.
+
+\wxheading{wxBitmap}
+
+Under Windows, wxBitmap may load the following formats:
+
+\begin{itemize}\itemsep=0pt
+\item Windows bitmap resource (wxBITMAP\_TYPE\_BMP\_RESOURCE)
+\item Windows bitmap file (wxBITMAP\_TYPE\_BMP)
+\item PNG file (wxBITMAP\_TYPE\_PNG). Currently 4-bit (16-colour) PNG files do not load properly.
+\item XPM data and file (wxBITMAP\_TYPE\_XPM)
+\end{itemize}
+
+Under wxGTK, wxBitmap may load the following formats:
+
+\begin{itemize}\itemsep=0pt
+\item Windows bitmap file (wxBITMAP\_TYPE\_BMP)
+\item PNG (wxBITMAP\_TYPE\_PNG).
+\item XPM data and file (wxBITMAP\_TYPE\_XPM)
+\end{itemize}
+
+Under wxMotif, wxBitmap may load the following formats:
 
-There is provision for a number of bitmap
-formats via the standard wxBitmap class. These facilities can
-be enabled or disabled using settings in wx\_setup.h.
+\begin{itemize}\itemsep=0pt
+%\item Windows bitmap file (wxBITMAP\_TYPE\_BMP)
+%\item PNG (wxBITMAP\_TYPE\_PNG).
+\item XBM data and file (wxBITMAP\_TYPE\_XBM)
+\item XPM data and file (wxBITMAP\_TYPE\_XPM)
+\end{itemize}
 
-XPM colour pixmaps may be loaded and saved under Windows and X, with
-some restrictions imposed by the lack of colourmap facility when
-using XPM files. The user may elect to use XPM files as a cross-platform
-stabdard, or translate between XPM and BMP files using a suitable
-utility.
+\wxheading{wxIcon}
 
-Also, under Windows, DIBs (device independent bitmaps with extension BMP)
-may be dynamically loaded and saved. Under X, GIF and BMP files may be
-loaded but not saved.
+Under Windows, wxIcon may load the following formats:
 
-\subsection{Bitmap format handlers}
+\begin{itemize}\itemsep=0pt
+\item Windows icon resource (wxBITMAP\_TYPE\_ICO\_RESOURCE)
+\item Windows icon file (wxBITMAP\_TYPE\_ICO)
+\item XPM data and file (wxBITMAP\_TYPE\_XPM)
+\end{itemize}
+
+Under wxGTK, wxIcon may load the following formats:
+
+\begin{itemize}\itemsep=0pt
+\item PNG (wxBITMAP\_TYPE\_PNG).
+\item XPM data and file (wxBITMAP\_TYPE\_XPM)
+\end{itemize}
+
+Under wxMotif, wxIcon may load the following formats:
+
+\begin{itemize}\itemsep=0pt
+%\item Windows bitmap file (wxBITMAP\_TYPE\_BMP)
+%\item PNG (wxBITMAP\_TYPE\_PNG).
+\item XBM data and file (wxBITMAP\_TYPE\_XBM)
+\item XPM data and file (wxBITMAP\_TYPE\_XPM)
+\end{itemize}
+
+\wxheading{wxCursor}
+
+Under Windows, wxCursor may load the following formats:
+
+\begin{itemize}\itemsep=0pt
+\item Windows cursor resource (wxBITMAP\_TYPE\_CUR\_RESOURCE)
+\item Windows cursor file (wxBITMAP\_TYPE\_CUR)
+\item Windows icon file (wxBITMAP\_TYPE\_ICO)
+\item Windows bitmap file (wxBITMAP\_TYPE\_BMP)
+\end{itemize}
+
+Under wxGTK, wxCursor may load the following formats (in additional
+to stock cursors):
+
+\begin{itemize}\itemsep=0pt
+\item None (stock cursors only).
+\end{itemize}
+
+Under wxMotif, wxCursor may load the following formats:
+
+\begin{itemize}\itemsep=0pt
+\item XBM data and file (wxBITMAP\_TYPE\_XBM)
+\end{itemize}
+
+\subsection{Bitmap format handlers}\label{bitmaphandlers}
 
 To provide extensibility, the functionality for loading and saving bitmap formats
 is not implemented in the wxBitmap class, but in a number of handler classes,
@@ -66,20 +146,21 @@ then call the static function \helpref{wxBitmap::AddHandler}{wxbitmapaddhandler}
 
 {\small
 \begin{verbatim}
-  #include "JPEGBitmapHandler.h"
+  #include <wx/pnghand.h>
+  #include <wx/xpmhand.h>
   ...
   // Initialisation
-  wxBitmap::AddHandler(new wxJPEGBitmapHandler);
+  wxBitmap::AddHandler(new wxPNGFileHandler);
+  wxBitmap::AddHandler(new wxXPMFileHandler);
+  wxBitmap::AddHandler(new wxXPMDataHandler);
   ...
 \end{verbatim}
 }
 
-Assuming wxJPEGBitmapHandler has been written correctly, you should now be able to load and save JPEG files
-using the usual wxBitmap API.
-
-To see how bitmap handlers are implemented, please look at the files {\tt bitmap.h} and {\tt bitmap.cpp}.
-
-\subsection{wxIcon overview}\label{wxiconoverview}
+Assuming the handlers have been written correctly, you should now be able to load and save PNG files
+and XPM files using the usual wxBitmap API.
 
-TODO.
+{\bf Note:} bitmap handlers are not implemented on all platforms. Currently, the above is only necessary on
+Windows, to save the extra overhead of formats that may not be necessary (if you don't use them, they
+are not linked into the executable). Unix platforms have PNG and XPM capability built-in (where supported).
 
diff --git a/docs/latex/wx/tdelwin.tex b/docs/latex/wx/tdelwin.tex
index e8b591cde9..33e368dd68 100644
--- a/docs/latex/wx/tdelwin.tex
+++ b/docs/latex/wx/tdelwin.tex
@@ -110,9 +110,8 @@ dialog, using the EVT\_CLOSE macro. The event handler function might look like t
 
 \wxheading{How do I exit the application gracefully?}
 
-A wxWindows application automatically exits when the top frame (returned
-from \helpref{wxApp::OnInit}{wxapponinit}) is destroyed. This may be modified
-in later versions to exit only when the {\it last} top-level frame is destroyed.
+A wxWindows application automatically exits when the designated top window, or the
+last frame or dialog, is destroyed.
 
 \wxheading{Do child windows get deleted automatically?}
 
diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt
index 3498240cd9..fcffaadfbf 100644
--- a/docs/motif/todo.txt
+++ b/docs/motif/todo.txt
@@ -41,6 +41,8 @@ High Priority
 
 - Get wxGLCanvas from 1.68 working.
 
+- Use wxImage to load other formats into wxBitmaps, such as PNG, BMP.
+
 Low Priority
 ------------
 
diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h
index aa9fa411f6..46c1c5b951 100644
--- a/include/wx/msw/bitmap.h
+++ b/include/wx/msw/bitmap.h
@@ -129,11 +129,9 @@ public:
   // Initialize with raw data
   wxBitmap(const char bits[], int width, int height, int depth = 1);
 
-#if wxUSE_XPM_IN_MSW
-  class wxItem;
+  class WXDLLEXPORT wxItem;
   // Initialize with XPM data
   wxBitmap(char **data, wxItem *anItem = NULL);
-#endif
 
   // Load a file or resource
   wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
diff --git a/include/wx/msw/pnghand.h b/include/wx/msw/pnghand.h
index 3fb34992fe..373ab863d0 100644
--- a/include/wx/msw/pnghand.h
+++ b/include/wx/msw/pnghand.h
@@ -13,6 +13,9 @@
 #pragma interface "pnghand.h"
 #endif
 
+#ifndef _WX_PNGHAND_H_
+#define _WX_PNGHAND_H_
+
 class WXDLLEXPORT wxPNGFileHandler: public wxBitmapHandler
 {
   DECLARE_DYNAMIC_CLASS(wxPNGFileHandler)
@@ -29,3 +32,6 @@ public:
   virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
 };
 
+#endif
+  // _WX_PNGHAND_H_
+
diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h
index b59284a738..a80f9d6243 100644
--- a/include/wx/msw/setup.h
+++ b/include/wx/msw/setup.h
@@ -79,7 +79,7 @@
 
 #define wxUSE_SCROLLBAR   1
                                     // Define 1 to compile contributed wxScrollBar class
-#define wxUSE_XPM_IN_MSW  0
+#define wxUSE_XPM_IN_MSW  1
                                     // Define 1 to support the XPM package in wxBitmap.
 #define wxUSE_IMAGE_LOADING_IN_MSW        1
                                   // Use dynamic DIB loading/saving code in utils/dib under MSW.
diff --git a/include/wx/msw/xpmhand.h b/include/wx/msw/xpmhand.h
new file mode 100644
index 0000000000..2289cd1995
--- /dev/null
+++ b/include/wx/msw/xpmhand.h
@@ -0,0 +1,51 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xpmhand.h
+// Purpose:     XPM bitmap handler
+// Author:      Julian Smart
+// Modified by:
+// Created:     04/01/98
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:   	wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma interface "xpmhand.h"
+#endif
+
+#ifndef _WX_XPMHAND_H_
+#define _WX_XPMHAND_H_
+
+class WXDLLEXPORT wxXPMFileHandler: public wxBitmapHandler
+{
+  DECLARE_DYNAMIC_CLASS(wxXPMFileHandler)
+public:
+  inline wxXPMFileHandler(void)
+  {
+  m_name = "XPM bitmap file";
+  m_extension = "xpm";
+  m_type = wxBITMAP_TYPE_XPM;
+  };
+
+  virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
+    int desiredWidth = -1, int desiredHeight = -1);
+  virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
+};
+
+class WXDLLEXPORT wxXPMDataHandler: public wxBitmapHandler
+{
+  DECLARE_DYNAMIC_CLASS(wxXPMDataHandler)
+public:
+  inline wxXPMDataHandler(void)
+  {
+  m_name = "XPM bitmap data";
+  m_extension = "xpm";
+  m_type = wxBITMAP_TYPE_XPM_DATA;
+  };
+
+  virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
+};
+
+#endif
+  // _WX_XPMHAND_H_
+
diff --git a/include/wx/xpmhand.h b/include/wx/xpmhand.h
new file mode 100644
index 0000000000..9a848a0f8c
--- /dev/null
+++ b/include/wx/xpmhand.h
@@ -0,0 +1,11 @@
+#ifndef _WX_XPMHAND_H_BASE_
+#define _WX_XPMHAND_H_BASE_
+
+// Only wxMSW currently defines a separate XPM handler, since
+// mostly Windows apps won't need XPMs.
+#if defined(__WXMSW__)
+#include "wx/msw/xpmhand.h"
+#endif
+
+#endif
+    // _WX_XPMHAND_H_BASE_
diff --git a/samples/makefile.nt b/samples/makefile.nt
index a2d1489e8e..ec5f6e6fb2 100644
--- a/samples/makefile.nt
+++ b/samples/makefile.nt
@@ -23,69 +23,73 @@ LINK_DEBUG_FLAGS="/RELEASE"
 
 all:
         cd $(WXDIR)\samples\splitter
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\resource
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\controls
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\listctrl
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\treectrl
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\validate
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\mdi
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\minimal
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\layout
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\printing
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\toolbar
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\dialogs
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\docview
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\docvwmdi
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\controls
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\nativdlg
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\grid
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\internat
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\dnd
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\joytest
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\taskbar
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\sashtest
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
+!if "$(FINAL)" == "0"
         cd $(WXDIR)\samples\memcheck
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+!endif
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\ownerdrw
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\checklst
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\minifram
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\bombs
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\fractal
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\wxpoem
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
-        cd $(WXDIR)\samples\types
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
+        cd $(WXDIR)\samples\typetest
+        nmake -f makefile.nt FINAL=$(FINAL)
         cd $(WXDIR)\samples\proplist
-        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+        nmake -f makefile.nt FINAL=$(FINAL)
+        cd $(WXDIR)\samples\image
+        nmake -f makefile.nt FINAL=$(FINAL)
 #        cd $(WXDIR)\samples\regtest
-#        nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS)
+#        nmake -f makefile.nt FINAL=$(FINAL)
 
 clean:
         cd $(WXDIR)\samples\splitter
@@ -146,8 +150,10 @@ clean:
         nmake -f makefile.nt clean
         cd $(WXDIR)\samples\wxpoem
         nmake -f makefile.nt clean
-        cd $(WXDIR)\samples\types
+        cd $(WXDIR)\samples\typetest
         nmake -f makefile.nt clean
         cd $(WXDIR)\samples\proplist
         nmake -f makefile.nt clean
+        cd $(WXDIR)\samples\image
+        nmake -f makefile.nt clean
 
diff --git a/samples/png/pngdemo.cpp b/samples/png/pngdemo.cpp
index 8cc344029f..07d19ac4a5 100644
--- a/samples/png/pngdemo.cpp
+++ b/samples/png/pngdemo.cpp
@@ -22,6 +22,7 @@
 
 #ifdef __WXMSW__
 #include <wx/pnghand.h>
+// #include <wx/xpmhand.h>
 #endif
 
 #include "pngdemo.h"
@@ -39,6 +40,8 @@ bool MyApp::OnInit(void)
 {
 #ifdef __WXMSW__
   wxBitmap::AddHandler(new wxPNGFileHandler);
+//  wxBitmap::AddHandler(new wxXPMFileHandler);
+//  wxBitmap::AddHandler(new wxXPMDataHandler);
 #endif
 
   // Create the main frame window
diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp
index e935db2c76..f51174c5b3 100644
--- a/src/msw/bitmap.cpp
+++ b/src/msw/bitmap.cpp
@@ -37,11 +37,6 @@
 
 #include "assert.h"
 
-#if wxUSE_XPM_IN_MSW
-#define FOR_MSW 1
-#include "../src/xpm/xpm34.h"
-#endif
-
 #include "wx/msw/dib.h"
 
 #if !USE_SHARED_LIBRARIES
@@ -146,6 +141,12 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits
     wxTheBitmapList->AddBitmap(this);
 }
 
+// Create from XPM data
+wxBitmap::wxBitmap(char **data, wxItem *WXUNUSED(anItem))
+{
+  (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
+}
+
 wxBitmap::wxBitmap(int w, int h, int d)
 {
   (void)Create(w, h, d);
@@ -170,14 +171,6 @@ wxBitmap::wxBitmap(const wxString& filename, long type)
     wxTheBitmapList->AddBitmap(this);
 }
 
-#if wxUSE_XPM_IN_MSW
-// Create from data
-wxBitmap::wxBitmap(char **data, wxItem *WXUNUSED(anItem))
-{
-  (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
-}
-#endif
-
 bool wxBitmap::Create(int w, int h, int d)
 {
   UnRef();
@@ -696,169 +689,6 @@ bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type
 #endif
 }
 
-class WXDLLEXPORT wxXPMFileHandler: public wxBitmapHandler
-{
-  DECLARE_DYNAMIC_CLASS(wxXPMFileHandler)
-public:
-  inline wxXPMFileHandler(void)
-  {
-  m_name = "XPM bitmap file";
-  m_extension = "xpm";
-  m_type = wxBITMAP_TYPE_XPM;
-  };
-
-  virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
-    int desiredWidth = -1, int desiredHeight = -1);
-  virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
-};
-IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
-
-bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
-    int desiredWidth, int desiredHeight)
-{
-#if wxUSE_XPM_IN_MSW
-    XImage *ximage;
-    XpmAttributes xpmAttr;
-    HDC     dc;
-
-    M_BITMAPHANDLERDATA->m_ok = FALSE;
-    dc = CreateCompatibleDC(NULL);
-    if (dc)
-    {
-      xpmAttr.valuemask = XpmReturnPixels;
-      int errorStatus = XpmReadFileToImage(&dc, WXSTRINGCAST name, &ximage, (XImage **) NULL, &xpmAttr);
-      DeleteDC(dc);
-      if (errorStatus == XpmSuccess)
-      {
-        M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ximage->bitmap;
-
-        BITMAP  bm;
-        GetObject((HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap, sizeof(bm), (LPSTR) & bm);
-
-        M_BITMAPHANDLERDATA->m_width = (bm.bmWidth);
-        M_BITMAPHANDLERDATA->m_height = (bm.bmHeight);
-        M_BITMAPHANDLERDATA->m_depth = (bm.bmPlanes * bm.bmBitsPixel);
-        M_BITMAPHANDLERDATA->m_numColors = xpmAttr.npixels;
-        XpmFreeAttributes(&xpmAttr);
-        XImageFree(ximage);
-
-        M_BITMAPHANDLERDATA->m_ok = TRUE;
-        return TRUE;
-      }
-      else
-      {
-        M_BITMAPHANDLERDATA->m_ok = FALSE;
-        return FALSE;
-      }
-    }
-#endif
-
-    return FALSE;
-}
-
-bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
-{
-#if wxUSE_XPM_IN_MSW
-    HDC     dc = NULL;
-    
-    XImage  ximage;
-    
-    dc = CreateCompatibleDC(NULL);
-    if (dc)
-    {
-        if (SelectObject(dc, (HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap))
-        {
-            /* for following SetPixel */
-            /* fill the XImage struct 'by hand' */
-            ximage.width = M_BITMAPHANDLERDATA->m_width; 
-            ximage.height = M_BITMAPHANDLERDATA->m_height;
-            ximage.depth = M_BITMAPHANDLERDATA->m_depth; 
-            ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap;
-            int errorStatus = XpmWriteFileFromImage(&dc, WXSTRINGCAST name,
-                &ximage, (XImage *) NULL, (XpmAttributes *) NULL);
-            
-            if (dc)
-                DeleteDC(dc);
-            
-            if (errorStatus == XpmSuccess)
-                return TRUE;    /* no error */
-            else
-                return FALSE;
-        } else return FALSE;
-    } else return FALSE;
-#else
-    return FALSE;
-#endif
-}
-
-class WXDLLEXPORT wxXPMDataHandler: public wxBitmapHandler
-{
-  DECLARE_DYNAMIC_CLASS(wxXPMDataHandler)
-public:
-  inline wxXPMDataHandler(void)
-  {
-  m_name = "XPM bitmap data";
-  m_extension = "xpm";
-  m_type = wxBITMAP_TYPE_XPM_DATA;
-  };
-
-  virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
-};
-IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
-
-bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
-{
-#if wxUSE_XPM_IN_MSW
-  XImage *ximage;
-  int     ErrorStatus;
-  XpmAttributes xpmAttr;
-  HDC     dc;
-
-  M_BITMAPHANDLERDATA->m_ok = FALSE;
-  M_BITMAPHANDLERDATA->m_numColors = 0;
-
-  dc = CreateCompatibleDC(NULL);  /* memory DC */
-
-  if (dc)
-  {
-    xpmAttr.valuemask = XpmReturnInfos; /* get infos back */
-    ErrorStatus = XpmCreateImageFromData(&dc, (char **)data,
-         &ximage, (XImage **) NULL, &xpmAttr);
-
-    if (ErrorStatus == XpmSuccess)
-    {
-      /* ximage is malloced and contains bitmap and attributes */
-      M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ximage->bitmap;
-
-      BITMAP  bm;
-      GetObject((HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap, sizeof(bm), (LPSTR) & bm);
-
-      M_BITMAPHANDLERDATA->m_width = (bm.bmWidth);
-      M_BITMAPHANDLERDATA->m_height = (bm.bmHeight);
-      M_BITMAPHANDLERDATA->m_depth = (bm.bmPlanes * bm.bmBitsPixel);
-      M_BITMAPHANDLERDATA->m_numColors = xpmAttr.npixels;
-      XpmFreeAttributes(&xpmAttr);
-
-      XImageFree(ximage); // releases the malloc, but does not detroy
-                          // the bitmap
-      M_BITMAPHANDLERDATA->m_ok = TRUE;
-      DeleteDC(dc);
-
-      return TRUE;
-    } 
-    else
-    {
-      M_BITMAPHANDLERDATA->m_ok = FALSE;
-//    XpmDebugError(ErrorStatus, NULL);
-      DeleteDC(dc);
-      return FALSE;
-    }
-  }
-#endif
-
-  return FALSE;
-}
-
 void wxBitmap::CleanUpHandlers(void)
 {
   wxNode *node = sm_handlers.First();
@@ -876,8 +706,12 @@ void wxBitmap::InitStandardHandlers(void)
 {
   AddHandler(new wxBMPResourceHandler);
   AddHandler(new wxBMPFileHandler);
-  AddHandler(new wxXPMFileHandler);
-  AddHandler(new wxXPMDataHandler);
+
+  // Not added by default: include xpmhand.h in your app
+  // and call these in your wxApp::OnInit.
+//  AddHandler(new wxXPMFileHandler);
+//  AddHandler(new wxXPMDataHandler);
+
   AddHandler(new wxICOResourceHandler);
   AddHandler(new wxICOFileHandler);
 }
diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp
index 144c728fae..39272263ac 100644
--- a/src/msw/cursor.cpp
+++ b/src/msw/cursor.cpp
@@ -34,11 +34,6 @@
 
 #include "assert.h"
 
-#if wxUSE_XPM_IN_MSW
-#define FOR_MSW 1
-#include "../src/xpm/xpm34.h"
-#endif
-
 #if wxUSE_RESOURCE_LOADING_IN_MSW
 #include "wx/msw/curico.h"
 #include "wx/msw/curicop.h"
diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp
index ed875403a2..36ce690043 100644
--- a/src/msw/icon.cpp
+++ b/src/msw/icon.cpp
@@ -32,11 +32,6 @@
 #include "wx/msw/private.h"
 #include "assert.h"
 
-#if wxUSE_XPM_IN_MSW
-#define FOR_MSW 1
-#include "../src/xpm/xpm34.h"
-#endif
-
 #if wxUSE_RESOURCE_LOADING_IN_MSW
 #include "wx/msw/curico.h"
 #include "wx/msw/curicop.h"
diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32
index aa15bc4246..c9f91fb860 100644
--- a/src/msw/makefile.b32
+++ b/src/msw/makefile.b32
@@ -243,6 +243,7 @@ MSWOBJS = \
   $(MSWDIR)\utilsexc.obj \
   $(MSWDIR)\wave.obj \
   $(MSWDIR)\window.obj \
+  $(MSWDIR)\xpmhand.obj \
   $(MSWDIR)\droptgt.obj \
   $(MSWDIR)\dropsrc.obj \
   $(MSWDIR)\oleutils.obj \
diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc
index e887b9c1b2..f4a4898606 100644
--- a/src/msw/makefile.bcc
+++ b/src/msw/makefile.bcc
@@ -233,6 +233,7 @@ MSWOBJS = \
   $(MSWDIR)\utilsexc.obj \
   $(MSWDIR)\wave.obj \
   $(MSWDIR)\window.obj \
+  $(MSWDIR)\xpmhand.obj
 
 # Unfortunately this causes a crash when the oleauto sample starts.
 #  $(MSWDIR)\automtn.obj
diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos
index e7ef28afa6..2e24517e00 100644
--- a/src/msw/makefile.dos
+++ b/src/msw/makefile.dos
@@ -210,6 +210,10 @@ MSWOBJS = \
 #  $(OLEDIR)\oleutils.obj \
 #  $(OLEDIR)\uuid.obj
 
+# TODO: Implement XPM and PNG targets in this makefile!
+#  $(OLEDIR)\xpmhand \
+#  $(OLEDIR)\pnghand \
+
 # Not appropriate for 16-bit Windows
 #  $(MSWDIR)\registry.obj \
 #  $(MSWDIR)\dirdlg.obj \
diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95
index 21199e7ca6..2106fb52ba 100644
--- a/src/msw/makefile.g95
+++ b/src/msw/makefile.g95
@@ -224,7 +224,8 @@ MSWOBJS = \
   utils.$(OBJSUFF) \
   utilsexc.$(OBJSUFF) \
   wave.$(OBJSUFF) \
-  window.$(OBJSUFF)
+  window.$(OBJSUFF) \
+  xpmhand.$(OBJSUFF)
 
 # Native wxDirDlg can't be compiled due to GnuWin32/OLE limitations
 #  dirdlg.$(OBJSUFF) \
diff --git a/src/msw/makefile.nt b/src/msw/makefile.nt
index f8697d07ed..85fa790b88 100644
--- a/src/msw/makefile.nt
+++ b/src/msw/makefile.nt
@@ -180,7 +180,9 @@ MSWOBJS = \
   $(MSWDIR)\icon.obj \
   $(MSWDIR)\iniconf.obj \
   $(MSWDIR)\joystick.obj \
+  $(MSWDIR)\imaglist.obj \
   $(MSWDIR)\listbox.obj \
+  $(MSWDIR)\listctrl.obj \
   $(MSWDIR)\main.obj \
   $(MSWDIR)\mdi.obj \
   $(MSWDIR)\menu.obj \
@@ -189,6 +191,7 @@ MSWOBJS = \
   $(MSWDIR)\minifram.obj \
   $(MSWDIR)\msgdlg.obj \
   $(MSWDIR)\nativdlg.obj \
+  $(MSWDIR)\notebook.obj \
   $(MSWDIR)\ownerdrw.obj \
   $(MSWDIR)\palette.obj \
   $(MSWDIR)\pen.obj \
@@ -217,38 +220,24 @@ MSWOBJS = \
   $(MSWDIR)\textctrl.obj \
   $(MSWDIR)\thread.obj \
   $(MSWDIR)\timer.obj \
+  $(MSWDIR)\treectrl.obj \
   $(MSWDIR)\utils.obj \
   $(MSWDIR)\utilsexc.obj \
+  $(OLEDIR)\uuid.obj \
   $(MSWDIR)\wave.obj \
   $(MSWDIR)\window.obj \
-  $(MSWDIR)\notebook.obj \
-  $(MSWDIR)\listctrl.obj \
-  $(MSWDIR)\imaglist.obj \
-  $(MSWDIR)\treectrl.obj \
+  $(MSWDIR)\xpmhand.obj \
+  $(OLEDIR)\dataobj.obj \
+  $(OLEDIR)\automtn.obj \
   $(OLEDIR)\droptgt.obj \
   $(OLEDIR)\dropsrc.obj \
-  $(OLEDIR)\dataobj.obj \
-  $(OLEDIR)\oleutils.obj \
-  $(OLEDIR)\uuid.obj \
-  $(OLEDIR)\automtn.obj
-
-XPMOBJECTS = 	$(XPMDIR)\crbuffri.obj\
-		$(XPMDIR)\crdatfri.obj\
-		$(XPMDIR)\create.obj $(XPMDIR)\crifrbuf.obj\
-		$(XPMDIR)\crifrdat.obj\
-		$(XPMDIR)\data.obj\
-		$(XPMDIR)\hashtab.obj $(XPMDIR)\misc.obj\
-		$(XPMDIR)\parse.obj $(XPMDIR)\rdftodat.obj\
-		$(XPMDIR)\rdftoi.obj\
-		$(XPMDIR)\rgb.obj $(XPMDIR)\scan.obj\
-		$(XPMDIR)\simx.obj $(XPMDIR)\wrffrdat.obj\
-		$(XPMDIR)\wrffrp.obj $(XPMDIR)\wrffri.obj
+  $(OLEDIR)\oleutils.obj
 
 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
-OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) # $(XPMOBJECTS)
+OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
 
 # Normal, static library
-all:    $(DUMMYOBJ) $(OBJECTS) $(PERIPH_TARGET) png zlib $(LIBTARGET)
+all:    $(DUMMYOBJ) $(OBJECTS) $(PERIPH_TARGET) png zlib xpm $(LIBTARGET)
 
 # wxWindows library as DLL
 dll:
@@ -578,6 +567,11 @@ $(MSWDIR)/pnghand.obj:     $*.$(SRCSUFF)
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
 <<
 
+$(MSWDIR)/xpmhand.obj:     $*.$(SRCSUFF)
+        cl @<<
+$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
+<<
+
 $(MSWDIR)/printdlg.obj:     $*.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
@@ -1201,121 +1195,11 @@ $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
 
 $(OBJECTS):	$(WXDIR)/include/wx/setup.h
 
-$(XPMDIR)\crbuffri.obj: $(XPMDIR)\crbuffri.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\crbuffrp.obj: $(XPMDIR)\crbuffrp.c
-	 	cl @<<
-$(CPPFLAGS2) /c  $*.c /Fo$@
-<<
-
-$(XPMDIR)\crdatfri.obj: $(XPMDIR)\crdatfri.c
-	 	cl @<<
-$(CPPFLAGS2) /c  $*.c /Fo$@
-<<
-
-$(XPMDIR)\crdatfrp.obj: $(XPMDIR)\crdatfrp.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\create.obj: $(XPMDIR)\create.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\crifrbuf.obj: $(XPMDIR)\crifrbuf.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\crifrdat.obj: $(XPMDIR)\crifrdat.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\crpfrbuf.obj: $(XPMDIR)\crpfrbuf.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\crpfrdat.obj: $(XPMDIR)\crpfrdat.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\data.obj: $(XPMDIR)\data.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\hashtab.obj: $(XPMDIR)\hashtab.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\misc.obj: $(XPMDIR)\misc.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\parse.obj: $(XPMDIR)\parse.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\rdftodat.obj: $(XPMDIR)\rdftodat.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\rdftoi.obj: $(XPMDIR)\rdftoi.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\rdftop.obj: $(XPMDIR)\rdftop.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\rgb.obj: $(XPMDIR)\rgb.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\scan.obj: $(XPMDIR)\scan.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\simx.obj: $(XPMDIR)\simx.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\wrffrdat.obj: $(XPMDIR)\wrffrdat.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\wrffri.obj: $(XPMDIR)\wrffri.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
-$(XPMDIR)\wrffrp.obj: $(XPMDIR)\wrffrp.c
-	 	cl @<<
-$(CPPFLAGS2) /c $*.c /Fo$@
-<<
-
 # Peripheral components
 
 png:
     cd $(WXDIR)\src\png
-    nmake -f makefile.nt FINAL=$(FINAL)
+    nmake -f makefile.nt FINAL=$(FINAL) DLL=$(DLL) WXMAKINGDLL=$(WXMAKINGDLL)
     cd $(WXDIR)\src\msw
 
 clean_png:
@@ -1325,7 +1209,7 @@ clean_png:
 
 zlib:
     cd $(WXDIR)\src\zlib
-    nmake -f makefile.nt FINAL=$(FINAL)
+    nmake -f makefile.nt FINAL=$(FINAL) DLL=$(DLL) WXMAKINGDLL=$(WXMAKINGDLL)
     cd $(WXDIR)\src\msw
 
 clean_zlib:
@@ -1334,12 +1218,12 @@ clean_zlib:
     cd $(WXDIR)\src\msw
 
 xpm:
-    cd $(WXDIR)\src\wxxpm
-    nmake -f makefile.nt FINAL=$(FINAL)
+    cd $(WXDIR)\src\xpm
+    nmake -f makefile.nt FINAL=$(FINAL) DLL=$(DLL) WXMAKINGDLL=$(WXMAKINGDLL)
     cd $(WXDIR)\src\msw
 
 clean_xpm:
-    cd $(WXDIR)\src\wxxpm
+    cd $(WXDIR)\src\xpm
     nmake -f makefile.nt clean
     cd $(WXDIR)\src\msw
 
@@ -1348,22 +1232,7 @@ rcparser:
     nmake -f makefile.nt FINAL=$(FINAL)
     cd $(WXDIR)\src\msw
 
-wxstring:
-    cd $(WXDIR)\contrib\wxstring
-    nmake -f makefile.nt OPTIONS="$(OPTIONS)" DEBUG="$(DEBUG)" FINAL=$(FINAL)
-    cd $(WXDIR)\src\msw
-
-clean_wxstring:
-    cd $(WXDIR)\contrib\wxstring
-    nmake -f makefile.nt clean
-    cd $(WXDIR)\src\msw
-
-clean_rcp:
-    cd $(WXDIR)\utils\rcparser\src
-    nmake -f makefile.nt clean
-    cd $(WXDIR)\src\msw
-
-clean: $(PERIPH_CLEAN_TARGET) clean_png clean_zlib
+clean: $(PERIPH_CLEAN_TARGET) clean_png clean_zlib clean_xpm
         -erase *.obj
         -erase $(LIBTARGET)
         -erase $(WXDIR)\lib\*.pdb
diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc
index 42b89ee629..a7f1f9ca31 100644
--- a/src/msw/makefile.sc
+++ b/src/msw/makefile.sc
@@ -196,7 +196,8 @@ MSWOBJS = \
   $(MSWDIR)\utils.obj \
   $(MSWDIR)\utilsexc.obj \
   $(MSWDIR)\wave.obj \
-  $(MSWDIR)\window.obj
+  $(MSWDIR)\window.obj \
+  $(MSWDIR)\xpmhand.obj
 
 # Need Win95 support for these
 #  $(MSWDIR)\notebook.obj \
diff --git a/src/msw/makefile.sl b/src/msw/makefile.sl
new file mode 100644
index 0000000000..0bf8a3c46a
--- /dev/null
+++ b/src/msw/makefile.sl
@@ -0,0 +1,954 @@
+#
+# File:		makefile.wat
+# Author:	Julian Smart
+# Created:	1998
+#
+# Makefile : Builds wxWindows library for Salford C++, WIN32
+
+# include $(WXDIR)\src\makesl.env
+
+FINAL=0
+SALFORDDIR=i:\salfordc
+
+.SUFFIXES:
+.SUFFIXES: .exe .obj .c .cc .cpp .res .rc .def .lib
+
+#WXDIR = d:\wx2\wxwind~1
+WXDIR = $(WXWIN)
+WXINC = $(WXDIR)\include
+
+# Suffixes
+OBJSUFF=obj
+SRCSUFF=cpp
+
+DEBUGFLAGS     = /DEFINE __WXDEBUG__
+
+RC = src
+
+CCC         = scc
+CC         =  scc
+MODEL       =
+# If you use win95, assumptions will be made about Win95 icon format etc.
+# so nt_win is probably better for simultaneous Win32s/Win95/NT operation.
+LINKOPTION  = nt_win # win95
+BINDCOMMAND = wrc
+WATLIBDIR   = $(WATCOMDIR)\lib386\nt
+MINDATA     =
+MAXDATA     =
+STACK       =
+# EXTRALIBS   = $(WXDIR)\lib\zlib.lib $(WXDIR)\lib\png.lib $(WXDIR)\lib\xpm.lib &
+#      $(WATLIBDIR)\odbc32.lib $(WATLIBDIR)\comctl32.lib $(WATLIBDIR)\comdlg32.lib &
+#      $(WATLIBDIR)\ole32.lib $(WATLIBDIR)\oleaut32.lib $(WATLIBDIR)\uuid.lib
+IFLAGS      = /INCLUDE $(WXINC) /INCLUDE $(SALFORDDIR)\include
+#RESFLAGS1   = -r -bt=nt /i$(WXDIR)\include
+#RESFLAGS2   = -R $(name) /i$(WXDIR)\include
+
+OPTFLAGS=
+
+# /d1 for line numbers only: anything else produces an enormous wx32.lib
+CPPFLAGS    = /WINDOWS /ERROR_NUMBERS /DELETE_OBJ_ON_ERROR /DEFINE WIN32 /DEFINE __WIN32__ /DEFINE __WIN95__ /DEFINE __WINDOWS__ /DEFINE __WXMSW__ /DEFINE __SALFORDC__ $(OPTFLAGS) $(DEBUGFLAGS) $(EXTRACPPFLAGS)
+
+#.cpp.obj:
+#    echo Compiling!
+#    $(CCC) $(CPPFLAGS) $(IFLAGS) $@ $*.cpp
+
+#.c.obj: # $< # .AUTODEPEND
+#    $(CC) $(CPPFLAGS) $(IFLAGS) $@ $*.cpp
+
+
+
+WXLIB = $(WXDIR)\lib
+
+LIBTARGET   = $(WXLIB)\wx.lib
+DUMMY=dummydll
+# ODBCLIB     = ..\..\contrib\odbc\odbc32.lib
+
+EXTRATARGETS = xpm png zlib
+EXTRATARGETSCLEAN = clean_xpm clean_png clean_zlib
+GENDIR=$(WXDIR)\src\generic
+COMMDIR=$(WXDIR)\src\common
+XPMDIR=$(WXDIR)\src\xpm
+OLEDIR=ole
+MSWDIR=$(WXDIR)\src\msw
+
+DOCDIR = $(WXDIR)\docs
+
+GENERICOBJS= choicdgg.obj \
+  gridg.obj \
+  laywin.obj \
+  panelg.obj \
+  prop.obj \
+  propform.obj \
+  proplist.obj \
+  sashwin.obj \
+  scrolwin.obj \
+  splitter.obj \
+  statusbr.obj \
+  tabg.obj \
+  textdlgg.obj
+
+# These are generic things that don't need to be compiled on MSW,
+# but sometimes it's useful to do so for testing purposes.
+NONESSENTIALOBJS= printps.obj \
+  prntdlgg.obj \
+  msgdlgg.obj \
+  helpxlp.obj \
+  colrdlgg.obj \
+  fontdlgg.obj \
+  postscrp.obj
+
+COMMONOBJS = cmndata.obj \
+  config.obj \
+  docview.obj \
+  docmdi.obj \
+  dynarray.obj \
+  dynlib.obj \
+  event.obj \
+  file.obj \
+  filefn.obj \
+  fileconf.obj \
+  framecmn.obj \
+  gdicmn.obj \
+  image.obj \
+  intl.obj \
+  ipcbase.obj \
+  helpbase.obj \
+  layout.obj \
+  log.obj \
+  memory.obj \
+  mimetype.obj \
+  module.obj \
+  object.obj \
+  prntbase.obj \
+  resource.obj \
+  tbarbase.obj \
+  tbarsmpl.obj \
+  textfile.obj \
+  timercmn.obj \
+  utilscmn.obj \
+  validate.obj \
+  valtext.obj \
+  date.obj \
+  hash.obj \
+  list.obj \
+  string.obj \
+  socket.obj \
+  sckaddr.obj \
+  sckfile.obj \
+  sckipc.obj \
+  sckstrm.obj \
+  url.obj \
+  http.obj \
+  protocol.obj \
+  time.obj \
+  tokenzr.obj \
+  wxexpr.obj \
+  y_tab.obj \
+  extended.obj \
+  process.obj \
+  wfstream.obj \
+  mstream.obj \
+  zstream.obj \
+  stream.obj \
+  datstrm.obj \
+  objstrm.obj \
+  variant.obj \
+  wincmn.obj
+
+# Can't compile these yet under Salford C++
+#  odbc.obj \
+#  db.obj \
+#  dbtable.obj \
+
+MSWOBJS = \
+  accel.obj \
+  app.obj \
+  bitmap.obj \
+  bmpbuttn.obj \
+  brush.obj \
+  button.obj \
+  checkbox.obj \
+  checklst.obj \
+  choice.obj \
+  clipbrd.obj \
+  colordlg.obj \
+  colour.obj \
+  combobox.obj \
+  control.obj \
+  curico.obj \
+  cursor.obj \
+  data.obj \
+  dc.obj \
+  dcmemory.obj \
+  dcclient.obj \
+  dcprint.obj \
+  dcscreen.obj \
+  dde.obj \
+  dialog.obj \
+  dib.obj \
+  dibutils.obj \
+  dirdlg.obj \
+  filedlg.obj \
+  font.obj \
+  fontdlg.obj \
+  frame.obj \
+  gauge95.obj \
+  gaugemsw.obj \
+  gdiobj.obj \
+  helpwin.obj \
+  icon.obj \
+  imaglist.obj \
+  iniconf.obj \
+  joystick.obj \
+  listbox.obj \
+  listctrl.obj \
+  main.obj \
+  mdi.obj \
+  menu.obj \
+  menuitem.obj \
+  metafile.obj \
+  minifram.obj \
+  msgdlg.obj \
+  nativdlg.obj \
+  notebook.obj \
+  ownerdrw.obj \
+  palette.obj \
+  pen.obj \
+  penwin.obj \
+  printdlg.obj \
+  printwin.obj \
+  radiobox.obj \
+  radiobut.obj \
+  region.obj \
+  registry.obj \
+  regconf.obj \
+  scrolbar.obj \
+  settings.obj \
+  slidrmsw.obj \
+  slider95.obj \
+  spinbutt.obj \
+  statbmp.obj \
+  statbox.obj \
+  statbr95.obj \
+  stattext.obj \
+  tabctrl.obj \
+  taskbar.obj \
+  tbar95.obj \
+  tbarmsw.obj \
+  textctrl.obj \
+  thread.obj \
+  timer.obj \
+  treectrl.obj \
+  utils.obj \
+  utilsexc.obj \
+  wave.obj \
+  window.obj \
+  xpmhand.obj
+
+#  pnghand.obj \
+
+OLEOBJS = \
+  droptgt.obj \
+  dropsrc.obj \
+  dataobj.obj \
+  oleutils.obj \
+  uuid.obj \
+  automtn.obj
+
+# Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
+OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) $(OLEOBJS)
+
+all:        $(OBJECTS) $(LIBTARGET) $(EXTRATARGETS)
+
+$(LIBTARGET) : $(OBJECTS)
+    %create tmp.lnk
+    @%append tmp.lnk archive $(LIBTARGET)
+    @for %i in ( $(OBJECTS) ) do @%append tmp.lnk addobj %i
+    @%append file
+    slink @tmp.lnk
+
+clean:   $(EXTRATARGETSCLEAN)
+    -erase *.obj
+    -erase $(LIBTARGET)
+    -erase *.pch
+    -erase *.err
+    -erase *.lnk
+
+cleanall:   clean
+
+test:   test.obj
+
+test.obj:     test.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) test.cpp
+
+accel.obj:     $(MSWDIR)\accel.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\accel.cpp /BINARY accel.obj
+
+app.obj:     $(MSWDIR)\app.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\app.cpp /BINARY app.obj
+
+bitmap.obj:     $(MSWDIR)\bitmap.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\bitmap.cpp /BINARY bitmap.obj
+
+bmpbuttn.obj:     $(MSWDIR)\bmpbuttn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\bmpbuttn.cpp /BINARY bmpbuttn.obj
+
+brush.obj:     $(MSWDIR)\brush.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\brush.cpp /BINARY brush.obj
+
+button.obj:     $(MSWDIR)\button.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\button.cpp /BINARY button.obj
+
+choice.obj:     $(MSWDIR)\choice.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\choice.cpp /BINARY choice.obj
+
+checkbox.obj:     $(MSWDIR)\checkbox.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\checkbox.cpp /BINARY checkbox.obj
+
+checklst.obj:     $(MSWDIR)\checklst.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\checklst.cpp /BINARY checklst.obj
+
+clipbrd.obj:     $(MSWDIR)\clipbrd.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\clipbrd.cpp /BINARY clipbrd.obj
+
+colordlg.obj:     $(MSWDIR)\colordlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\colordlg.cpp /BINARY colordlg.obj
+
+colour.obj:     $(MSWDIR)\colour.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\colour.cpp /BINARY colour.obj
+
+combobox.obj:     $(MSWDIR)\combobox.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\combobox.cpp /BINARY combobox.obj
+
+control.obj:     $(MSWDIR)\control.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\control.cpp /BINARY control.obj
+
+curico.obj:     $(MSWDIR)\curico.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\curico.cpp /BINARY curico.obj
+
+cursor.obj:     $(MSWDIR)\cursor.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\cursor.cpp /BINARY cursor.obj
+
+data.obj:     $(MSWDIR)\data.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\data.cpp /BINARY data.obj
+
+dde.obj:     $(MSWDIR)\dde.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dde.cpp /BINARY dde.obj
+
+dc.obj:     $(MSWDIR)\dc.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dc.cpp /BINARY dc.obj
+
+dcmemory.obj:     $(MSWDIR)\dcmemory.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dcmemory.cpp /BINARY dcmemory.obj
+
+dcclient.obj:     $(MSWDIR)\dcclient.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dcclient.cpp /BINARY dcclient.obj
+
+dcprint.obj:     $(MSWDIR)\dcprint.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dcprint.cpp /BINARY dcprint.obj
+
+dcscreen.obj:     $(MSWDIR)\dcscreen.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dcscreen.cpp /BINARY dcscreen.obj
+
+dialog.obj:     $(MSWDIR)\dialog.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dialog.cpp /BINARY dialog.obj
+
+dib.obj:     $(MSWDIR)\dib.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dib.cpp /BINARY dib.obj
+
+dibutils.obj:     $(MSWDIR)\dibutils.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dibutils.cpp /BINARY dibutils.obj
+
+dirdlg.obj:     $(MSWDIR)\dirdlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\dirdlg.cpp /BINARY dirdlg.obj
+
+filedlg.obj:     $(MSWDIR)\filedlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\filedlg.cpp /BINARY filedlg.obj
+
+font.obj:     $(MSWDIR)\font.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\font.cpp /BINARY font.obj
+
+fontdlg.obj:     $(MSWDIR)\fontdlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\fontdlg.cpp /BINARY fontdlg.obj
+
+frame.obj:     $(MSWDIR)\frame.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\frame.cpp /BINARY frame.obj
+
+gauge95.obj:     $(MSWDIR)\gauge95.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\gauge95.cpp /BINARY gauge95.obj
+
+gaugemsw.obj:     $(MSWDIR)\gaugemsw.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\gaugemsw.cpp /BINARY gaugemsw.obj
+
+gdiobj.obj:     $(MSWDIR)\gdiobj.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\gdiobj.cpp /BINARY gdiobj.obj
+
+icon.obj:     $(MSWDIR)\icon.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\icon.cpp /BINARY icon.obj
+
+imaglist.obj:     $(MSWDIR)\imaglist.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\imaglist.cpp /BINARY imaglist.obj
+
+joystick.obj:     $(MSWDIR)\joystick.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\joystick.cpp /BINARY joystick.obj
+
+listbox.obj:     $(MSWDIR)\listbox.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\listbox.cpp /BINARY listbox.obj
+
+listctrl.obj:     $(MSWDIR)\listctrl.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\listctrl.cpp /BINARY listctrl.obj
+
+main.obj:     $(MSWDIR)\main.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\main.cpp /BINARY main.obj
+
+mdi.obj:     $(MSWDIR)\mdi.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\mdi.cpp /BINARY mdi.obj
+
+menu.obj:     $(MSWDIR)\menu.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\menu.cpp /BINARY menu.obj
+
+menuitem.obj:     $(MSWDIR)\menuitem.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\menuitem.cpp /BINARY menuitem.obj
+
+metafile.obj:     $(MSWDIR)\metafile.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\metafile.cpp /BINARY metafile.obj
+
+minifram.obj:     $(MSWDIR)\minifram.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\minifram.cpp /BINARY minifram.obj
+
+msgdlg.obj:     $(MSWDIR)\msgdlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\msgdlg.cpp /BINARY mdgdlg.obj
+
+nativdlg.obj:     $(MSWDIR)\nativdlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\nativdlg.cpp /BINARY nativdlg.obj
+
+notebook.obj:     $(MSWDIR)\notebook.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\notebook.cpp /BINARY notebook.obj
+
+ownerdrw.obj:     $(MSWDIR)\ownerdrw.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\ownerdrw.cpp /BINARY ownerdrw.obj
+
+palette.obj:     $(MSWDIR)\palette.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\palette.cpp /BINARY palette.obj
+
+pen.obj:     $(MSWDIR)\pen.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\pen.cpp /BINARY pen.obj
+
+penwin.obj:     $(MSWDIR)\penwin.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\penwin.cpp /BINARY penwin.obj
+
+pnghand.obj:     $(MSWDIR)\pnghand.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\pnghand.cpp /BINARY pnghand.obj
+
+printdlg.obj:     $(MSWDIR)\printdlg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\printdlg.cpp /BINARY printdlg.obj
+
+printwin.obj:     $(MSWDIR)\printwin.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\printwin.cpp /BINARY printwin.obj
+
+radiobox.obj:     $(MSWDIR)\radiobox.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\radiobox.cpp /BINARY radiobox.obj
+
+radiobut.obj:     $(MSWDIR)\radiobut.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\radiobut.cpp /BINARY radiobut.obj
+
+region.obj:     $(MSWDIR)\region.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\region.cpp /BINARY region.obj
+
+registry.obj:     $(MSWDIR)\registry.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\registry.cpp /BINARY registry.obj
+
+regconf.obj:     $(MSWDIR)\regconf.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\regconf.cpp /BINARY regconf.obj
+
+scrolbar.obj:     $(MSWDIR)\scrolbar.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\scrolbar.cpp /BINARY scrolbar.obj
+
+settings.obj:     $(MSWDIR)\settings.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\settings.cpp /BINARY settings.obj
+
+slidrmsw.obj:     $(MSWDIR)\slidrmsw.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\slidrmsw.cpp /BINARY slidrmsw.obj
+
+slider95.obj:     $(MSWDIR)\slider95.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\slider95.cpp /BINARY slider.obj
+
+spinbutt.obj:     $(MSWDIR)\spinbutt.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\spinbutt.cpp /BINARY spinbutt.obj
+
+statbmp.obj:     $(MSWDIR)\statbmp.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\statbmp.cpp /BINARY statbmp.obj
+
+statbox.obj:     $(MSWDIR)\statbox.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\statbox.cpp /BINARY statbox.obj
+
+statbr95.obj:     $(MSWDIR)\statbr95.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\statbr95.cpp /BINARY statbr95.obj
+
+stattext.obj:     $(MSWDIR)\stattext.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\stattext.cpp /BINARY stattext.obj
+
+tabctrl.obj:     $(MSWDIR)\tabctrl.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\tabctrl.cpp /BINARY tabctrl.obj
+
+taskbar.obj:     $(MSWDIR)\taskbar.cpp
+        cl @<<
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\taskbar.cpp /BINARY taskbar.obj
+
+tbar95.obj:     $(MSWDIR)\tbar95.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\tbar95.cpp /BINARY tbar95.obj
+
+tbarmsw.obj:     $(MSWDIR)\tbarmsw.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\tbarmsw.cpp /BINARY tbarmsw.obj
+
+textctrl.obj:     $(MSWDIR)\textctrl.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\textctrl.cpp /BINARY textctrl.obj
+
+thread.obj:     $(MSWDIR)\thread.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\thread.cpp /BINARY thread.obj
+
+timer.obj:     $(MSWDIR)\timer.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\timer.cpp /BINARY timer.obj
+
+treectrl.obj:     $(MSWDIR)\treectrl.cpp
+        cl @<<
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\treectrl.cpp /BINARY treectrl.obj
+
+utils.obj:     $(MSWDIR)\utils.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\utils.cpp /BINARY utils.obj
+
+utilsexc.obj:     $(MSWDIR)\utilsexc.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\utilsexc.cpp /BINARY utilsexc.obj
+
+wave.obj:     $(MSWDIR)\wave.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\wave.cpp /BINARY wave.obj
+
+window.obj:     $(MSWDIR)\window.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\window.cpp /BINARY window.obj
+
+xpmhand.obj:     $(MSWDIR)\xpmhand.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(MSWDIR)\xpmhand.cpp /BINARY xpmhand.obj
+
+droptgt.obj:     $(OLEDIR)\droptgt.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(OLEDIR)\droptgt.cpp /BINARY droptgt.obj
+
+dropsrc.obj:     $(OLEDIR)\dropsrc.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(OLEDIR)\dropsrc.cpp /BINARY dropsrc.obj
+
+dataobj.obj:     $(OLEDIR)\dataobj.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(OLEDIR)\dataobj.cpp /BINARY dataobj.obj
+
+oleutils.obj:     $(OLEDIR)\oleutils.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(OLEDIR)\oleutils.cpp /BINARY oleutils.obj
+
+uuid.obj:     $(OLEDIR)\uuid.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(OLEDIR)\uuid.cpp /BINARY uuid.obj
+
+automtn.obj:     $(OLEDIR)\automtn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(OLEDIR)\automtn.cpp /BINARY automtn.obj
+
+########################################################
+# Common objects (always compiled)
+
+cmndata.obj:     $(COMMDIR)\cmndata.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\cmndata.cpp /BINARY cmndata.obj
+
+config.obj:     $(COMMDIR)\config.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\config.cpp /BINARY config.obj
+
+db.obj:     $(COMMDIR)\db.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\db.cpp /BINARY db.obj
+
+dbtable.obj:     $(COMMDIR)\dbtable.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\dbtable.cpp /BINARY dbtable.obj
+
+docview.obj:     $(COMMDIR)\docview.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\docview.cpp /BINARY docview.obj
+
+docmdi.obj:     $(COMMDIR)\docmdi.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\docmdi.cpp /BINARY docmdi.obj
+
+dynarray.obj:     $(COMMDIR)\dynarray.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\dynarray.cpp /BINARY dynarray.obj
+
+dynlib.obj:     $(COMMDIR)\dynlib.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\dynlib.cpp /BINARY dynlib.obj
+
+event.obj:     $(COMMDIR)\event.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\event.cpp /BINARY event.obj
+
+file.obj:     $(COMMDIR)\file.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\file.cpp /BINARY file.obj
+
+fileconf.obj:     $(COMMDIR)\fileconf.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\fileconf.cpp /BINARY fileconf.obj
+
+filefn.obj:     $(COMMDIR)\filefn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\filefn.cpp /BINARY filefn.obj
+
+framecmn.obj:     $(COMMDIR)\framecmn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\framecmn.cpp /BINARY framecmn.obj
+
+gdicmn.obj:     $(COMMDIR)\gdicmn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\gdicmn.cpp /BINARY gdicmn.obj
+
+image.obj:     $(COMMDIR)\image.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\image.cpp /BINARY image.obj
+
+intl.obj:     $(COMMDIR)\intl.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\intl.cpp /BINARY intl.obj
+
+ipcbase.obj:     $(COMMDIR)\ipcbase.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\ipcbase.cpp /BINARY ipcbase.obj
+
+helpbase.obj:     $(COMMDIR)\helpbase.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\helpbase.cpp /BINARY helpbase.obj
+
+layout.obj:     $(COMMDIR)\layout.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\layout.cpp /BINARY layout.obj
+
+log.obj:     $(COMMDIR)\log.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\log.cpp /BINARY log.obj
+
+memory.obj:     $(COMMDIR)\memory.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\memory.cpp /BINARY memory.obj
+
+mimetype.obj:     $(COMMDIR)\mimetype.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\mimetype.cpp /BINARY mimetype.obj
+
+module.obj:     $(COMMDIR)\module.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\module.cpp /BINARY module.obj
+
+object.obj:     $(COMMDIR)\object.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\object.cpp /BINARY object.obj
+
+odbc.obj:     $(COMMDIR)\odbc.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\odbc.cpp /BINARY odbc.obj
+
+postscrp.obj:     $(COMMDIR)\postcrp.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\postcrp.cpp /BINARY postscrp.obj
+
+prntbase.obj:     $(COMMDIR)\prntbase.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\prntbase.cpp /BINARY prntbase.obj
+
+resource.obj:     $(COMMDIR)\resource.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\resource.cpp /BINARY resource.obj
+
+tbarbase.obj:     $(COMMDIR)\tbarbase.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\tbarbase.cpp /BINARY tbarbase.obj
+
+tbarsmpl.obj:     $(COMMDIR)\tbarsmpl.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\tbarsmpl.cpp /BINARY tbarsmpl.obj
+
+textfile.obj:     $(COMMDIR)\textfile.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\textfile.cpp /BINARY textfile.obj
+
+timercmn.obj:     $(COMMDIR)\timercmn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\timercmn.cpp /BINARY timercmn.obj
+
+utilscmn.obj:     $(COMMDIR)\utilscmn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\utilscmn.cpp /BINARY utilscmn.obj
+
+validate.obj:     $(COMMDIR)\validate.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\validate.cpp /BINARY validate.obj
+
+valtext.obj:     $(COMMDIR)\valtext.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\valtext.cpp /BINARY valtext.obj
+
+date.obj:     $(COMMDIR)\date.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\date.cpp /BINARY date.obj
+
+wxexpr.obj:     $(COMMDIR)\wxexpr.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\wxexpr.cpp /BINARY wxexpr.obj
+
+hash.obj:     $(COMMDIR)\hash.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\hash.cpp /BINARY hash.obj
+
+list.obj:     $(COMMDIR)\list.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\list.cpp /BINARY list.obj
+
+string.obj:     $(COMMDIR)\string.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\string.cpp /BINARY string.obj
+
+socket.obj:     $(COMMDIR)\socket.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\socket.cpp /BINARY socket.obj
+
+sckaddr.obj:     $(COMMDIR)\sckaddr.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\sckaddr.cpp /BINARY sckaddr.obj
+
+sckfile.obj:     $(COMMDIR)\sckfile.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\sckfile.cpp /BINARY sckfile.obj
+
+sckipc.obj:     $(COMMDIR)\sckipc.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\sckipc.cpp /BINARY sckipc.obj
+
+sckstrm.obj:     $(COMMDIR)\sckstrm.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\sckstrm.cpp /BINARY sockstrm.obj
+
+url.obj:     $(COMMDIR)\url.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\url.cpp /BINARY url.obj
+
+http.obj:     $(COMMDIR)\http.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\http.cpp /BINARY http.obj
+
+protocol.obj:     $(COMMDIR)\protocol.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\protocol.cpp /BINARY protocol.obj
+
+tokenzr.obj:     $(COMMDIR)\tokenzr.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\tokenzr.cpp /BINARY tokenzr.obj
+
+matrix.obj:     $(COMMDIR)\matrix.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\matrix.cpp /BINARY matrix.obj
+
+time.obj:     $(COMMDIR)\time.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\time.cpp /BINARY timer.obj
+
+stream.obj:     $(COMMDIR)\stream.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\stream.cpp /BINARY stream.obj
+
+wfstream.obj:     $(COMMDIR)\wfstream.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\wfstream.cpp /BINARY wfstream.obj
+
+mstream.obj:     $(COMMDIR)\mstream.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\mstream.cpp /BINARY mstream.obj
+
+zstream.obj:     $(COMMDIR)\zstream.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\zstream.cpp /BINARY zstream.obj
+
+datstrm.obj:     $(COMMDIR)\datstrm.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\datstrm.cpp /BINARY datstrm.obj
+
+objstrm.obj:     $(COMMDIR)\objstrm.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\objstrm.cpp /BINARY objstrm.obj
+
+extended.obj:     $(COMMDIR)\extended.c
+  $(CC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\extended.c /BINARY extended.obj
+
+process.obj:     $(COMMDIR)\process.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\process.cpp /BINARY process.obj
+
+variant.obj:     $(COMMDIR)\variant.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\variant.cpp /BINARY variant.obj
+
+wincmn.obj:     $(COMMDIR)\wincmn.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\wincmn.cpp /BINARY wincmn.obj
+
+########################################################
+# Generic objects (not always compiled, depending on
+# whether platforms have native implementations)
+
+choicdgg.obj:     $(GENDIR)\choicdgg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\choicdgg.cpp /BINARY choicdgg.obj
+
+colrdlgg.obj:     $(GENDIR)\colrdgg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\colrdgg.cpp /BINARY colordgg.obj
+
+fontdlgg.obj:     $(GENDIR)\fontdlgg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\fontdlgg.cpp /BINARY fontdlgg.obj
+
+gridg.obj:     $(GENDIR)\gridg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\gridg.cpp /BINARY gridg.obj
+
+helpxlp.obj:     $(GENDIR)\helpxlp.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\helpxlp.cpp /BINARY helpxlp.obj
+
+laywin.obj:     $(GENDIR)\laywin.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\laywin.cpp /BINARY laywin.obj
+
+msgdlgg.obj:     $(GENDIR)\msgdlgg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\msgdlgg.cpp /BINARY msgdlgg.obj
+
+panelg.obj:     $(GENDIR)\panelg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\panelg.cpp /BINARY panelg.obj
+
+printps.obj:     $(GENDIR)\printps.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\printps.cpp /BINARY printps.obj
+
+prop.obj:     $(GENDIR)\prop.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\prop.cpp /BINARY prop.obj
+
+propform.obj:     $(GENDIR)\propform.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\propform.cpp /BINARY propform.obj
+
+proplist.obj:     $(GENDIR)\proplist.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\proplist.cpp /BINARY proplist.obj
+
+prntdlgg.obj:     $(GENDIR)\prntdlgg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\prntdlgg.cpp /BINARY prntdlgg.obj
+
+sashwin.obj:     $(GENDIR)\sashwin.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\sashwin.cpp /BINARY sashwin.obj
+
+scrolwin.obj:     $(GENDIR)\scrolwin.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\scrolwin.cpp /BINARY scrolwin.obj
+
+splitter.obj:     $(GENDIR)\splitter.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\splitter.cpp /BINARY splitter.obj
+
+statusbr.obj:     $(GENDIR)\statusbr.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\statusbr.cpp /BINARY statusbr.obj
+
+tabg.obj:     $(GENDIR)\tabg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\tabg.cpp /BINARY tabg.obj
+
+textdlgg.obj: $(GENDIR)\textdlgg.cpp
+  $(CCC) $(CPPFLAGS) $(IFLAGS) $(GENDIR)\textdlgg.cpp /BINARY textdlgg.obj
+
+crbuffri.obj: $(XPMDIR)\crbuffri.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crbuffri.c
+
+crbuffrp.obj: $(XPMDIR)\crbuffrp.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crbuffrp.c
+
+crdatfri.obj: $(XPMDIR)\crdatfri.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crdatfri.c
+
+crdatfrp.obj: $(XPMDIR)\crdatfrp.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crdatfrp.c
+
+create.obj: $(XPMDIR)\create.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\create.c
+
+crifrbuf.obj: $(XPMDIR)\crifrbuf.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crifrbuf.c
+
+crifrdat.obj: $(XPMDIR)\crifrdat.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crifrdat.c
+
+crpfrbuf.obj: $(XPMDIR)\crpfrbuf.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crpfrbuf.c
+
+crpfrdat.obj: $(XPMDIR)\crpfrdat.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\crpfrdat.c
+
+dataxpm.obj: $(XPMDIR)\data.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\data.c /BINARY dataxpm.obj
+
+hashtab.obj: $(XPMDIR)\hashtab.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\hashtab.c
+
+misc.obj: $(XPMDIR)\misc.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\misc.c
+
+parse.obj: $(XPMDIR)\parse.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\parse.c
+
+rdftodat.obj: $(XPMDIR)\rdftodat.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\rdftodat.c
+
+rdftoi.obj: $(XPMDIR)\rdftoi.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\rdftoi.c
+
+rdftop.obj: $(XPMDIR)\rdftop.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\rdftop.c
+
+rgb.obj: $(XPMDIR)\rgb.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\rgb.c
+
+scan.obj: $(XPMDIR)\scan.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\scan.c
+
+simx.obj: $(XPMDIR)\simx.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\simx.c
+
+wrffrdat.obj: $(XPMDIR)\wrffrdat.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\wrffrdat.c
+
+wrffri.obj: $(XPMDIR)\wrffri.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\wrffri.c
+
+wrffrp.obj: $(XPMDIR)\wrffrp.c
+  *$(CC) $(CPPFLAGS) $(IFLAGS) $(XPMDIR)\wrffrp.c
+
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+  trees$(O) 
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+  infutil$(O) inffast$(O) 
+
+adler32.obj: adler32.c zutil.h zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zutil.h zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+   infcodes.h infutil.h
+	$(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+   infcodes.h inffast.h
+	$(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+	$(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+	$(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+	$(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+	$(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+	$(CC) -c $(CFLAGS) $*.c
+
+
+y_tab.obj:     $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
+  $(CC) $(CPPFLAGS) $(IFLAGS) -DUSE_DEFINE $(COMMDIR)\y_tab.c
+
+#  *$(CC) $(CPPFLAGS) $(IFLAGS) -DUSE_DEFINE -DYY_USE_PROTOS $(COMMDIR)\y_tab.c
+
+$(COMMDIR)\y_tab.c:     $(COMMDIR)\dosyacc.c
+        copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
+
+$(COMMDIR)\lex_yy.c:    $(COMMDIR)\doslex.c
+    copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
+
+xpm:   .SYMBOLIC
+    cd $(WXDIR)\src\xpm
+    wmake -f makefile.wat all
+    cd $(WXDIR)\src\msw
+
+clean_xpm:   .SYMBOLIC
+    cd $(WXDIR)\src\xpm
+    wmake -f makefile.wat clean
+    cd $(WXDIR)\src\msw
+
+png:   .SYMBOLIC
+    cd $(WXDIR)\src\png
+    wmake -f makefile.wat all
+    cd $(WXDIR)\src\msw
+
+clean_png:   .SYMBOLIC
+    cd $(WXDIR)\src\png
+    wmake -f makefile.wat clean
+    cd $(WXDIR)\src\msw
+
+zlib:   .SYMBOLIC
+    cd $(WXDIR)\src\zlib
+    wmake -f makefile.wat all
+    cd $(WXDIR)\src\msw
+
+clean_zlib:   .SYMBOLIC
+    cd $(WXDIR)\src\zlib
+    wmake -f makefile.wat clean
+    cd $(WXDIR)\src\msw
+
+
diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat
index 01dfd8694c..af97828765 100644
--- a/src/msw/makefile.wat
+++ b/src/msw/makefile.wat
@@ -196,6 +196,7 @@ MSWOBJS = &
   utilsexc.obj &
   wave.obj &
   window.obj &
+  xpmhand.obj
 
 #  pnghand.obj &
 
@@ -477,6 +478,9 @@ wave.obj:     $(MSWDIR)\wave.cpp
 window.obj:     $(MSWDIR)\window.cpp
   *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
 
+xpmhand.obj:     $(MSWDIR)\xpmhand.cpp
+  *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
+
 droptgt.obj:     $(OLEDIR)\droptgt.cpp
   *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
 
diff --git a/src/msw/xpmhand.cpp b/src/msw/xpmhand.cpp
new file mode 100644
index 0000000000..0432f686b9
--- /dev/null
+++ b/src/msw/xpmhand.cpp
@@ -0,0 +1,182 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xpmhand.cpp
+// Purpose:     wxBitmap: XPM handler and constructors
+// Author:      Julian Smart
+// Modified by:
+// Created:     04/01/98
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "xpmhand.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include <stdio.h>
+#include "wx/setup.h"
+#include "wx/list.h"
+#include "wx/utils.h"
+#include "wx/app.h"
+#include "wx/palette.h"
+#include "wx/dcmemory.h"
+#include "wx/bitmap.h"
+#include "wx/icon.h"
+#endif
+
+#include "wx/msw/private.h"
+#include "wx/log.h"
+
+#include "assert.h"
+
+#if wxUSE_XPM_IN_MSW
+#define FOR_MSW 1
+#include "../src/xpm/xpm34.h"
+#endif
+
+#include "wx/xpmhand.h"
+#include "wx/msw/dib.h"
+
+IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
+
+bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
+    int desiredWidth, int desiredHeight)
+{
+#if wxUSE_XPM_IN_MSW
+    XImage *ximage;
+    XpmAttributes xpmAttr;
+    HDC     dc;
+
+    M_BITMAPHANDLERDATA->m_ok = FALSE;
+    dc = CreateCompatibleDC(NULL);
+    if (dc)
+    {
+      xpmAttr.valuemask = XpmReturnPixels;
+      int errorStatus = XpmReadFileToImage(&dc, WXSTRINGCAST name, &ximage, (XImage **) NULL, &xpmAttr);
+      DeleteDC(dc);
+      if (errorStatus == XpmSuccess)
+      {
+        M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ximage->bitmap;
+
+        BITMAP  bm;
+        GetObject((HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap, sizeof(bm), (LPSTR) & bm);
+
+        M_BITMAPHANDLERDATA->m_width = (bm.bmWidth);
+        M_BITMAPHANDLERDATA->m_height = (bm.bmHeight);
+        M_BITMAPHANDLERDATA->m_depth = (bm.bmPlanes * bm.bmBitsPixel);
+        M_BITMAPHANDLERDATA->m_numColors = xpmAttr.npixels;
+        XpmFreeAttributes(&xpmAttr);
+        XImageFree(ximage);
+
+        M_BITMAPHANDLERDATA->m_ok = TRUE;
+        return TRUE;
+      }
+      else
+      {
+        M_BITMAPHANDLERDATA->m_ok = FALSE;
+        return FALSE;
+      }
+    }
+#endif
+
+    return FALSE;
+}
+
+bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
+{
+#if wxUSE_XPM_IN_MSW
+    HDC     dc = NULL;
+    
+    XImage  ximage;
+    
+    dc = CreateCompatibleDC(NULL);
+    if (dc)
+    {
+        if (SelectObject(dc, (HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap))
+        {
+            /* for following SetPixel */
+            /* fill the XImage struct 'by hand' */
+            ximage.width = M_BITMAPHANDLERDATA->m_width; 
+            ximage.height = M_BITMAPHANDLERDATA->m_height;
+            ximage.depth = M_BITMAPHANDLERDATA->m_depth; 
+            ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap;
+            int errorStatus = XpmWriteFileFromImage(&dc, WXSTRINGCAST name,
+                &ximage, (XImage *) NULL, (XpmAttributes *) NULL);
+            
+            if (dc)
+                DeleteDC(dc);
+            
+            if (errorStatus == XpmSuccess)
+                return TRUE;    /* no error */
+            else
+                return FALSE;
+        } else return FALSE;
+    } else return FALSE;
+#else
+    return FALSE;
+#endif
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
+
+bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
+{
+#if wxUSE_XPM_IN_MSW
+  XImage *ximage;
+  int     ErrorStatus;
+  XpmAttributes xpmAttr;
+  HDC     dc;
+
+  M_BITMAPHANDLERDATA->m_ok = FALSE;
+  M_BITMAPHANDLERDATA->m_numColors = 0;
+
+  dc = CreateCompatibleDC(NULL);  /* memory DC */
+
+  if (dc)
+  {
+    xpmAttr.valuemask = XpmReturnInfos; /* get infos back */
+    ErrorStatus = XpmCreateImageFromData(&dc, (char **)data,
+         &ximage, (XImage **) NULL, &xpmAttr);
+
+    if (ErrorStatus == XpmSuccess)
+    {
+      /* ximage is malloced and contains bitmap and attributes */
+      M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ximage->bitmap;
+
+      BITMAP  bm;
+      GetObject((HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap, sizeof(bm), (LPSTR) & bm);
+
+      M_BITMAPHANDLERDATA->m_width = (bm.bmWidth);
+      M_BITMAPHANDLERDATA->m_height = (bm.bmHeight);
+      M_BITMAPHANDLERDATA->m_depth = (bm.bmPlanes * bm.bmBitsPixel);
+      M_BITMAPHANDLERDATA->m_numColors = xpmAttr.npixels;
+      XpmFreeAttributes(&xpmAttr);
+
+      XImageFree(ximage); // releases the malloc, but does not detroy
+                          // the bitmap
+      M_BITMAPHANDLERDATA->m_ok = TRUE;
+      DeleteDC(dc);
+
+      return TRUE;
+    } 
+    else
+    {
+      M_BITMAPHANDLERDATA->m_ok = FALSE;
+//    XpmDebugError(ErrorStatus, NULL);
+      DeleteDC(dc);
+      return FALSE;
+    }
+  }
+#endif
+
+  return FALSE;
+}
+
diff --git a/src/ntwxwin.mak b/src/ntwxwin.mak
index 18ec6b8f64..01d08574fd 100644
--- a/src/ntwxwin.mak
+++ b/src/ntwxwin.mak
@@ -100,7 +100,7 @@ EXTRADLLFLAGS=$(EXTRADLLFLAGS) /DNOMAIN
 !endif
 
 INC=-I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib $(EXTRAINC)
-LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\winpng.lib $(WXDIR)\lib\zlib.lib
+LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\winpng.lib $(WXDIR)\lib\zlib.lib $(WXDIR)\lib\xpm.lib
 
 !ifndef FINAL
 FINAL=0
diff --git a/src/xpm/makefile.nt b/src/xpm/makefile.nt
new file mode 100644
index 0000000000..ad52164624
--- /dev/null
+++ b/src/xpm/makefile.nt
@@ -0,0 +1,170 @@
+#
+# File:		makefile.nt
+# Author:	Julian Smart
+# Created:	1997
+# Updated:
+# Copyright:	(c) 1997, Julian Smart
+#
+# "%W% %G%"
+#
+# Makefile : Builds xpm.lib for VC++ (32-bit)
+#
+!include <..\ntwxwin.mak>
+
+THISDIR=$(WXWIN)\src\xpm
+
+LIBTARGET=$(WXDIR)\lib\xpm.lib
+
+# Please set these according to the settings in wx_setup.h, so we can include
+# the appropriate libraries in wx.lib
+
+# This one overrides the others, to be consistent with the settings in wx_setup.h
+MINIMAL_WXWINDOWS_SETUP=0
+
+PERIPH_LIBS=
+PERIPH_TARGET=
+PERIPH_CLEAN_TARGET=
+
+XPMDIR=$(WXDIR)\src\xpm
+
+OBJECTS = 	$(XPMDIR)\crbuffri.obj\
+		$(XPMDIR)\crdatfri.obj\
+		$(XPMDIR)\create.obj $(XPMDIR)\crifrbuf.obj\
+		$(XPMDIR)\crifrdat.obj\
+		$(XPMDIR)\data.obj\
+		$(XPMDIR)\hashtab.obj $(XPMDIR)\misc.obj\
+		$(XPMDIR)\parse.obj $(XPMDIR)\rdftodat.obj\
+		$(XPMDIR)\rdftoi.obj\
+		$(XPMDIR)\rgb.obj $(XPMDIR)\scan.obj\
+		$(XPMDIR)\simx.obj $(XPMDIR)\wrffrdat.obj\
+		$(XPMDIR)\wrffrp.obj $(XPMDIR)\wrffri.obj
+
+all:    $(LIBTARGET)
+
+$(LIBTARGET):      $(OBJECTS)
+	-erase $(LIBTARGET)
+	$(implib) @<<
+-out:$@
+-machine:$(CPU)
+$(OBJECTS) $(PERIPH_LIBS)
+<<
+
+$(XPMDIR)\crbuffri.obj: $(XPMDIR)\crbuffri.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\crbuffrp.obj: $(XPMDIR)\crbuffrp.c
+	 	cl @<<
+$(CPPFLAGS2) /c  $*.c /Fo$@
+<<
+
+$(XPMDIR)\crdatfri.obj: $(XPMDIR)\crdatfri.c
+	 	cl @<<
+$(CPPFLAGS2) /c  $*.c /Fo$@
+<<
+
+$(XPMDIR)\crdatfrp.obj: $(XPMDIR)\crdatfrp.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\create.obj: $(XPMDIR)\create.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\crifrbuf.obj: $(XPMDIR)\crifrbuf.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\crifrdat.obj: $(XPMDIR)\crifrdat.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\crpfrbuf.obj: $(XPMDIR)\crpfrbuf.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\crpfrdat.obj: $(XPMDIR)\crpfrdat.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\data.obj: $(XPMDIR)\data.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\hashtab.obj: $(XPMDIR)\hashtab.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\misc.obj: $(XPMDIR)\misc.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\parse.obj: $(XPMDIR)\parse.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\rdftodat.obj: $(XPMDIR)\rdftodat.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\rdftoi.obj: $(XPMDIR)\rdftoi.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\rdftop.obj: $(XPMDIR)\rdftop.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\rgb.obj: $(XPMDIR)\rgb.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\scan.obj: $(XPMDIR)\scan.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\simx.obj: $(XPMDIR)\simx.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\wrffrdat.obj: $(XPMDIR)\wrffrdat.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\wrffri.obj: $(XPMDIR)\wrffri.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+$(XPMDIR)\wrffrp.obj: $(XPMDIR)\wrffrp.c
+	 	cl @<<
+$(CPPFLAGS2) /c $*.c /Fo$@
+<<
+
+clean:
+        -erase *.obj
+        -erase $(LIBTARGET)
+        -erase *.pdb
+        -erase *.sbr
+        -erase *.pch
+
+cleanall: clean
+
-- 
2.50.0

