From 7921cf2badfac0c44cd53644bfc6a483a09ec299 Mon Sep 17 00:00:00 2001
From: Julian Smart <julian@anthemion.co.uk>
Date: Wed, 27 Jan 1999 10:01:14 +0000
Subject: [PATCH] Added dde sample; added docs/index.htm

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 distrib/msw/generic.rsp       |  20 +++-
 docs/changes.txt              |   3 +-
 docs/html/index.htm           | 105 ++++++++++++++++-
 docs/index.htm                |  37 ++++++
 docs/motif/install.txt        |   9 +-
 docs/motif/makewx             |   8 +-
 docs/readme.txt               |   3 +
 docs/todo.txt                 |   4 +-
 include/wx/msw/dde.h          |   9 --
 samples/dde/Makefile          |   1 +
 samples/dde/Makefile.in       |  28 +++++
 samples/dde/client.cpp        | 211 ++++++++++++++++++++++++++++++++++
 samples/dde/client.def        |   8 ++
 samples/dde/client.h          |  55 +++++++++
 samples/dde/client.rc         |   2 +
 samples/dde/client.vc         |  20 ++++
 samples/dde/client.wat        |  15 +++
 samples/dde/ddesetup.h        |  37 ++++++
 samples/dde/makefile.b32      |  82 +++++++++++++
 samples/dde/makefile.dos      |  19 +++
 samples/dde/makefile.g95      |  46 ++++++++
 samples/dde/makefile.vc       |  20 ++++
 samples/dde/mondrian.ico      | Bin 0 -> 766 bytes
 samples/dde/mondrian.xpm      |  44 +++++++
 samples/dde/server.cpp        | 196 +++++++++++++++++++++++++++++++
 samples/dde/server.def        |   8 ++
 samples/dde/server.h          |  70 +++++++++++
 samples/dde/server.rc         |   3 +
 samples/dde/server.vc         |  20 ++++
 samples/dde/server.wat        |  15 +++
 src/common/sckipc.cpp         |   4 +
 src/generic/helpxlp.cpp       |   1 -
 src/makefile.vc               |   6 +-
 src/makevc.env                |   2 +-
 src/png/makefile.vc           |   2 +-
 src/xpm/parse.c               |   1 +
 utils/tex2rtf/src/makefile.vc |   2 +-
 37 files changed, 1080 insertions(+), 36 deletions(-)
 create mode 100644 docs/index.htm
 create mode 100644 samples/dde/Makefile
 create mode 100644 samples/dde/Makefile.in
 create mode 100644 samples/dde/client.cpp
 create mode 100644 samples/dde/client.def
 create mode 100644 samples/dde/client.h
 create mode 100644 samples/dde/client.rc
 create mode 100644 samples/dde/client.vc
 create mode 100644 samples/dde/client.wat
 create mode 100644 samples/dde/ddesetup.h
 create mode 100644 samples/dde/makefile.b32
 create mode 100644 samples/dde/makefile.dos
 create mode 100644 samples/dde/makefile.g95
 create mode 100644 samples/dde/makefile.vc
 create mode 100644 samples/dde/mondrian.ico
 create mode 100644 samples/dde/mondrian.xpm
 create mode 100644 samples/dde/server.cpp
 create mode 100644 samples/dde/server.def
 create mode 100644 samples/dde/server.h
 create mode 100644 samples/dde/server.rc
 create mode 100644 samples/dde/server.vc
 create mode 100644 samples/dde/server.wat

diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp
index aab6594db7..16d214d487 100644
--- a/distrib/msw/generic.rsp
+++ b/distrib/msw/generic.rsp
@@ -10,7 +10,9 @@ docs/todo.txt
 docs/licence.txt
 docs/symbols.txt
 docs/bugs.txt
-docs/*.html
+docs/*.htm
+docs/html/*.htm
+docs/html/*.gif
 
 src/*.inc
 src/mkdir
@@ -638,3 +640,19 @@ samples/thread/*.png
 samples/thread/*.ico
 samples/thread/*.txt
 
+samples/dde/*.cpp
+samples/dde/*.h
+samples/dde/makefile*
+samples/dde/client.vc
+samples/dde/server.vc
+samples/dde/client.wat
+samples/dde/server.wat
+samples/dde/*.rc
+samples/dde/*.def
+samples/dde/*.bmp
+samples/dde/*.xpm
+samples/dde/*.xbm
+samples/dde/*.png
+samples/dde/*.ico
+samples/dde/*.txt
+
diff --git a/docs/changes.txt b/docs/changes.txt
index ef86b7df39..2de593966d 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -25,7 +25,8 @@ wxMotif:
 General:
 
 - wxBusyCursor class added.
-- More doc improvements.
+- Added samples/dde.
+- More doc improvements, incl. expanding docs/html/index.htm.
 
 Beta 2, January 1999
 --------------------
diff --git a/docs/html/index.htm b/docs/html/index.htm
index f5c242aab4..493a111e02 100644
--- a/docs/html/index.htm
+++ b/docs/html/index.htm
@@ -24,11 +24,22 @@
 
 <P>
 
-Welcome to wxWindows 2.0, the premiere cross-platform C++ framework. This is an index of
+Welcome to wxWindows 2, the premiere cross-platform GUI C++ framework. This is an index of
 the plain text and HTML documentation. Documentation is also available in Acrobat (PDF) and Windows Help,
 from the <a href="http://www.wxwindows.org">wxWindows Web site</a>.<P>
 
-<h3>Installation and release notes</h3>
+<CENTER>
+<FONT size=-1>
+[<a href="#install">Install</a>]
+[<a href="#manuals">Manuals</a>]
+[<a href="#thirdparty">3rd party tools</a>] 
+[<a href="#samples">Samples</a>]
+</FONT>
+</CENTER>
+
+<hr>
+
+<h3><a name="install">Installation and release notes</a></h3>
 
 <ul>
 <li>ReadMe: <a href="../readme.txt"><b>General ReadMe</b></a>,
@@ -60,18 +71,23 @@ from the <a href="http://www.wxwindows.org">wxWindows Web site</a>.<P>
 <li>List of <a href="../symbols.txt">preprocessor symbols</a> used in wxWindows
 </ul>
 
-<h3>wxWindows manuals</h3>
+<hr>
+
+
+<h3><a name="manuals">wxWindows manuals</a></h3>
 
 <ul>
 <li><a href="wx/wx.htm">Reference Manual</a>
-<li><a href="porting/port.htm">Porting Guide</a> (wxWindows 1.xx to 2.0)
+<li><a href="porting/port.htm">Porting Guide</a> (wxWindows 1.xx to 2)
 <li><a href="dialoged/dlged.htm">Dialog Editor</a>
 <li><a href="proplist/prop.htm">Property List Classes</a>
 <li><a href="wxtree/tree.htm">wxTreeLayout</a>
 <li><a href="odbc/odbc.htm">Remstar ODBC Classes</a>
 </ul>
 
-<h3>Third-party tools</h3>
+<hr>
+
+<h3><a name="thirdparty">Third-party tools</a></h3>
 
 <ul>
 <li><a href="gettext/gettext.htm">gettext manual</a>
@@ -79,6 +95,85 @@ from the <a href="http://www.wxwindows.org">wxWindows Web site</a>.<P>
 <li><a href="gettext/msgfmt.htm">msgfmt manual</a>
 </ul>
 
+<hr>
+
+<h3><a name="samples">Samples</a></h3>
+
+<ul>
+<li><a href="../../samples/bombs">bombs</a>: minesweeper-like game.
+<li><a href="../../samples/checklst">checklst</a>: demonstrates wxCheckListBox on
+supported platforms (currently Windows and GTK only).
+<li><a href="../../samples/config">config</a>: demonstrates use of wxConfig, which
+defaults to wxRegConfig on WIN32, wxIniConfig on WIN16, and wxFileConfig on other platforms.
+<li><a href="../../samples/controls">controls</a>: sample showing a variety of controls, including
+wxNotebook.
+<li><a href="../../samples/db">db</a>: wxDB ODBC sample.
+<li><a href="../../samples/dde">dde</a>: shows the DDE protocol in action, both using real
+DDE on Windows, and TCP/IP on all platforms. Edit <a href="../../samples/dde/ddesetup.h">ddesetup.h</a>
+to switch between compilation modes. Currently the TCP/IP mode needs a bit of work.
+<li><a href="../../samples/dialogs">dialogs</a>: shows some of the common dialogs available -- wxFontDialog,
+wxColourDialog, wxFileDialog, wxDirDialog, wxMessageBox, wxTextEntryDialog, wxSingleChoiceDialog.
+For printing-related dialogs, see the printing sample.
+<li><a href="../../samples/dnd">dnd</a>: demonstrates drag and drop on supported platforms.
+<li><a href="../../samples/docview">docview</a>: demonstrates use of the document view classes,
+using wxFrame.
+<li><a href="../../samples/docvwmdi">docvwmdi</a>: : demonstrates use of the document view classes,
+using wxMDIParentFrame, wxMDIChildFrame.
+<li><a href="../../samples/dynamic">dynamic</a>: shows how to connect events to member functions
+dynamically.
+<li><a href="../../samples/forty">forty</a>: a great little card game by Chris Breeze. A
+fully-fledged application!
+<li><a href="../../samples/fractal">fractal</a>: fractal mountains by Andrew Davison.
+<li><a href="../../samples/grid">grid</a>: demonstrates the wxGrid class.
+<li><a href="../../samples/help">help</a>: shows how to use wxHelpController.
+<li><a href="../../samples/image">image</a>: shows off the cross-platform wxImage class.
+<li><a href="../../samples/internat">internat</a>: use of wxWindows' internationalization support.
+<li><a href="../../samples/joytest">joytest</a>: tests the wxJoystick class (currently Windows and GTK only).
+<li><a href="../../samples/layout">layout</a>: shows the constraint layout system in action.
+<li><a href="../../samples/listctrl">listctrl</a>: demonstrates the wxListCtrl (implemented natively on
+WIN32, and using a generic version on other platforms).
+<li><a href="../../samples/mdi">mdi</a>: shows off the MDI (Multiple Document Interface) classes. On Windows, the regular MDI
+scheme is used whereby child windows have full sizing and moving rights within the main
+window. On other platforms, tabbed windows are used, where the children are always maximized.
+<li><a href="../../samples/memcheck">memcheck</a>: demonstrates the memory checking/debugging facilities.
+<li><a href="../../samples/mfc">mfc</a>: shows how to use MFC and wxWindows code in the same application (Windows only).
+<li><a href="../../samples/minifram">minifram</a>: demonstrates a frame with a small title bar. On
+platforms that don't support it, a normal-sized title bar is displayed.
+<li><a href="../../samples/minimal">minimal</a>: just shows a frame, a menubar, and a statusbar. About as
+small a wxWindows application as you can get.
+<li><a href="../../samples/nativdlg">nativdlg</a>: shows how wxWindows can load a standard Windows
+dialog resource, translating the controls into wxWindows controls (Windows only).
+<li><a href="../../samples/notebook">notebook</a>: shows the wxNotebook (tabbed window) control.
+<li><a href="../../samples/oleauto">oleauto</a>: a little OLE automation controller (Windows only; requires
+Excel to be present).
+<li><a href="../../samples/ownerdrw">ownerdrw</a>: demonstrates owner-draw menus and controls (Windows only).
+<li><a href="../../samples/png">png</a>: demonstrates PNG loading.
+<li><a href="../../samples/printing">printing</a>: shows printing and previewing.
+<li><a href="../../samples/proplist">proplist</a>: demonstrates the property list classes (a VB-style property editor).
+<li><a href="../../samples/regtest">regtest</a>: tests the low-level Windows registry functions (Windows only).
+<li><a href="../../samples/resource">resource</a>: shows how to use wxWindows resources (.wxr files).
+<li><a href="../../samples/sashtest">sashtest</a>: demonstrates use of the wxSashWindow class to allow
+the user to resize subwindows.
+<li><a href="../../samples/splitter">splitter</a>: demonstrates the wxSplitterWindow class.
+<li><a href="../../samples/tab">tab</a>: demonstrates the generic tab window class. You should
+normally use wxNotebook instead, but the generic code is sometimes useful, for example for
+implementing wxNotebook on platforms with no native support.
+<li><a href="../../samples/taskbar">taskbar</a>: demonstrates the wxTaskBarIcon class, for
+adding icons to the system tray. Windows only, but may eventually be implemented for other desktop
+environments that use this metaphor.
+<li><a href="../../samples/thread">thread</a>: tests the family of classes for doing thread
+programming.
+<li><a href="../../samples/toolbar">toolbar</a>: demonstrates wxToolBar.
+<li><a href="../../samples/treectrl">treectrl</a>: demonstrates wxTreeCtrl.
+<li><a href="../../samples/typetest">typetest</a>: tests various data type classes, including
+wxTime, wxDate and wxVariant.
+<li><a href="../../samples/validate">validate</a>: shows simple use of validation.
+<li><a href="../../samples/wxpoem">wxpoem</a>: a little poetry display program.
+<li><a href="../../samples/wxsocket">wxsocket</a>: demonstrates the TCP/IP family of classes.
+</ul>
+
+<hr>
+
 </font>
 
 </BODY>
diff --git a/docs/index.htm b/docs/index.htm
new file mode 100644
index 0000000000..7225bf9ba6
--- /dev/null
+++ b/docs/index.htm
@@ -0,0 +1,37 @@
+<HTML>
+
+<HEAD>
+<TITLE>Welcome to wxWindows 2</TITLE>
+
+</HEAD>
+
+<BODY BGCOLOR="#FFFFFF" TEXT=#000000 LINK=#FF0000 VLINK=#000000>
+
+<font face="Arial, Lucida Sans, Helvetica">
+
+<a name="top"></a>
+
+<table width=100% border=4 cellpadding=5 cellspacing=0>
+<tr>
+<td bgcolor="#660000">
+<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#FFFFFF">
+Welcome to wxWindows 2
+</font>
+</td>
+</tr>
+</table>
+
+<P>
+
+Welcome to wxWindows 2, the premiere cross-platform GUI C++ framework.<P>
+
+Please click on <a href="html/index.htm">docs/html/index.htm</a> to view the main document index.<P>
+
+Have fun!<P>
+
+</font>
+
+</BODY>
+
+</HTML>
+
diff --git a/docs/motif/install.txt b/docs/motif/install.txt
index f86f3cf0a9..f0fe889efe 100644
--- a/docs/motif/install.txt
+++ b/docs/motif/install.txt
@@ -23,14 +23,9 @@ COMPILING USING CONFIGURE
   in this directory):
 
   # Make wxMotif using the configure system
-  chmod a+x install/unix/config.sub
-  install/unix/setup/general/* \
-    install/unix/config.guess install/unix/setup/shared/*
-  cd install/unix
-  autoconf && ./configure --with-shared --with-motif --with-debug_flag \
+  chmod a+x configure config.sub setup/general/* config.guess setup/shared/*
+  ./configure --with-shared --with-motif --with-debug_flag \
    --with-debug_info --without-threads
-  cd ../..
-  make makefiles
   make
 
 COMPILING USING MAKEFILES
diff --git a/docs/motif/makewx b/docs/motif/makewx
index 97a114e343..82961e7433 100644
--- a/docs/motif/makewx
+++ b/docs/motif/makewx
@@ -1,7 +1,5 @@
 # Make wxMotif using the configure system
-chmod a+x install/unix/config.sub install/unix/setup/general/* install/unix/config.guess install/unix/setup/shared/*
-cd install/unix
-autoconf && ./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads
-cd ../..
-make makefiles
+chmod a+x configure config.sub setup/general/* config.guess setup/shared/*
+./configure --with-shared --with-motif --with-debug_flag --with-debug_info --without-threads
 make
+
diff --git a/docs/readme.txt b/docs/readme.txt
index 662d04dc24..aea251d13b 100644
--- a/docs/readme.txt
+++ b/docs/readme.txt
@@ -15,6 +15,9 @@ tree controls on Unix, they are emulated.
 A detailed 700-page reference manual is supplied in HTML, PDF and
 Windows Help form.
 
+For a quick start, point your Web browser at docs/html/index.htm for a list of
+important documents and samples.
+
 Platforms supported
 -------------------
 
diff --git a/docs/todo.txt b/docs/todo.txt
index ba884a2b0f..7af174dec8 100644
--- a/docs/todo.txt
+++ b/docs/todo.txt
@@ -16,7 +16,9 @@ Please see also:
 
 - Documentation: mention include files with each class.
 
-- Document wxTime.
+- Document/update wxTime.
+
+- Fix TCP/IP mode in dde sample (how to use; why does it crash).
 
 - Get Karsten to remove trashed CVS files:
 
diff --git a/include/wx/msw/dde.h b/include/wx/msw/dde.h
index 4a8a878319..5e7ec5e9f9 100644
--- a/include/wx/msw/dde.h
+++ b/include/wx/msw/dde.h
@@ -149,14 +149,5 @@ class WXDLLEXPORT wxDDEClient: public wxClientBase
 void WXDLLEXPORT wxDDEInitialize();
 void WXDLLEXPORT wxDDECleanUp();
 
-// Compatibility
-#if WXWIN_COMPATIBILITY
-#define wxServer wxDDEServer
-#define wxClient wxDDEClient
-#define wxConnection wxDDEConnection
-#define wxIPCInitialize wxDDEInitialize
-#define wxIPCCleanUp wxDDECleanUp
-#endif
-
 #endif
     // _WX_DDE_H_
diff --git a/samples/dde/Makefile b/samples/dde/Makefile
new file mode 100644
index 0000000000..bccce53f76
--- /dev/null
+++ b/samples/dde/Makefile
@@ -0,0 +1 @@
+include ../../setup/general/makeapp
diff --git a/samples/dde/Makefile.in b/samples/dde/Makefile.in
new file mode 100644
index 0000000000..68ded4e305
--- /dev/null
+++ b/samples/dde/Makefile.in
@@ -0,0 +1,28 @@
+# WXXT base directory
+WXBASEDIR=@WXBASEDIR@
+
+# set the OS type for compilation
+OS=@OS@
+# compile a library only
+RULE=bin2
+
+# define library name
+BIN_TARGET=client
+BIN2_TARGET=server
+# define library sources
+BIN_SRC= client.cpp
+BIN2_SRC= server.cpp
+
+#define library objects
+BIN_OBJ= client.o
+BIN2_OBJ= server.o
+
+# additional things needed to link
+BIN_LINK=
+BIN2_LINK=
+
+# additional things needed to compile
+ADD_COMPILE=
+
+# include the definitions now
+include ../../../template.mak
diff --git a/samples/dde/client.cpp b/samples/dde/client.cpp
new file mode 100644
index 0000000000..01430071ab
--- /dev/null
+++ b/samples/dde/client.cpp
@@ -0,0 +1,211 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        client.cpp
+// Purpose:     DDE sample: client
+// Author:      Julian Smart
+// Modified by:
+// Created:     25/01/99
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+// Settings common to both executables: determines whether
+// we're using TCP/IP or real DDE.
+
+#include "ddesetup.h"
+
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#include "mondrian.xpm"
+#endif
+
+#include "client.h"
+
+MyFrame *frame = NULL;
+
+IMPLEMENT_APP(MyApp)
+
+char ipc_buffer[4000];
+wxListBox *the_list = NULL;
+
+MyConnection *the_connection = NULL;
+MyClient *my_client ;
+
+// The `main program' equivalent, creating the windows and returning the
+// main frame
+bool MyApp::OnInit()
+{
+  // Create the main frame window
+  frame = new MyFrame(NULL, "Client", wxPoint(400, 0), wxSize(400, 300));
+
+  // Give it an icon
+  frame->SetIcon(wxICON(mondrian));
+
+  // Make a menubar
+  wxMenu *file_menu = new wxMenu;
+
+  file_menu->Append(CLIENT_EXECUTE, "Execute");
+  file_menu->Append(CLIENT_REQUEST, "Request");
+  file_menu->Append(CLIENT_POKE, "Poke");
+  file_menu->Append(CLIENT_QUIT, "Quit");
+
+  wxMenuBar *menu_bar = new wxMenuBar;
+
+  menu_bar->Append(file_menu, "File");
+
+  // Associate the menu bar with the frame
+  frame->SetMenuBar(menu_bar);
+
+  // Make a panel
+  frame->panel = new wxPanel(frame, -1, wxPoint(0, 0), wxSize(400, 250));
+  the_list = new wxListBox(frame->panel, CLIENT_LISTBOX, wxPoint(5, 5), wxSize(150, 120));
+  the_list->Append("Apple");
+  the_list->Append("Pear");
+  the_list->Append("Orange");
+  the_list->Append("Banana");
+  the_list->Append("Fruit");
+
+  frame->panel->Fit();
+  frame->Fit();
+
+  wxString server = "4242";
+  wxString hostName;
+  wxGetHostName(hostName);
+
+  if (argc > 1)
+    server = argv[1];
+  if (argc > 2)
+    hostName = argv[2];
+
+  // Create a new client
+  my_client = new MyClient;
+  the_connection = (MyConnection *)my_client->MakeConnection(hostName, server, "IPC TEST");
+
+  if (!the_connection)
+  {
+    wxMessageBox("Failed to make connection to server", "Client Demo Error");
+#ifdef __WXMSW__
+//    extern void wxPrintDDEError();
+//    wxPrintDDEError();
+#endif
+    return FALSE;
+  }
+  the_connection->StartAdvise("Item");
+
+  frame->Show(TRUE);
+
+  return TRUE;
+}
+
+int MyApp::OnExit()
+{
+    if (my_client)
+      delete my_client ;
+
+    return 0;
+}
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+    EVT_MENU(CLIENT_QUIT, MyFrame::OnExit)
+    EVT_MENU(CLIENT_EXECUTE, MyFrame::OnExecute)
+    EVT_MENU(CLIENT_POKE, MyFrame::OnPoke)
+    EVT_MENU(CLIENT_REQUEST, MyFrame::OnRequest)
+    EVT_CLOSE(MyFrame::OnCloseWindow)
+END_EVENT_TABLE()
+
+// Define my frame constructor
+MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
+  wxFrame(frame, -1, title, pos, size)
+{
+    panel = NULL;
+}
+
+void MyFrame::OnExecute(wxCommandEvent& event)
+{
+      if (the_connection)
+        the_connection->Execute("Hello from the client!");
+}
+
+void MyFrame::OnPoke(wxCommandEvent& event)
+{
+      if (the_connection)
+        the_connection->Poke("An item", "Some data to poke at the server!");
+}
+
+void MyFrame::OnRequest(wxCommandEvent& event)
+{
+      if (the_connection)
+      {
+        char *data = the_connection->Request("An item");
+        if (data)
+          wxMessageBox(data, "Client: Request", wxOK);
+      }
+}
+
+void MyFrame::OnExit(wxCommandEvent& event)
+{
+  if (the_connection)
+    the_connection->Disconnect();
+
+  this->Destroy();
+}
+
+// Define the behaviour for the frame closing
+void MyFrame::OnCloseWindow(wxCloseEvent& event)
+{
+  if (the_connection)
+  {
+    the_connection->Disconnect();
+  }
+  this->Destroy();
+}
+
+MyClient::MyClient(void)
+{
+}
+
+wxConnectionBase *MyClient::OnMakeConnection(void)
+{
+  return new MyConnection;
+}
+
+MyConnection::MyConnection(void):wxConnection(ipc_buffer, 3999)
+{
+}
+
+MyConnection::~MyConnection(void)
+{
+  the_connection = NULL;
+}
+
+bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format)
+{
+  if (the_list)
+  {
+    int n = the_list->FindString(data);
+    if (n > -1)
+      the_list->SetSelection(n);
+  }
+  return TRUE;
+}
+
+bool MyConnection::OnDisconnect()
+{
+    frame->Destroy();
+
+    the_connection = NULL;
+    delete this;
+
+    return TRUE;
+}
+
diff --git a/samples/dde/client.def b/samples/dde/client.def
new file mode 100644
index 0000000000..786b7d609a
--- /dev/null
+++ b/samples/dde/client.def
@@ -0,0 +1,8 @@
+NAME         Client
+DESCRIPTION  'Client'
+EXETYPE      WINDOWS
+STUB         'WINSTUB.EXE'
+CODE         PRELOAD MOVEABLE DISCARDABLE
+DATA         PRELOAD MOVEABLE MULTIPLE
+HEAPSIZE     1024
+STACKSIZE    8192
diff --git a/samples/dde/client.h b/samples/dde/client.h
new file mode 100644
index 0000000000..8017a29def
--- /dev/null
+++ b/samples/dde/client.h
@@ -0,0 +1,55 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        client.h
+// Purpose:     DDE sample: client
+// Author:      Julian Smart
+// Modified by:
+// Created:     25/01/99
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// Define a new application
+class MyApp: public wxApp
+{
+  public:
+    bool OnInit();
+    int OnExit();
+};
+
+// Define a new frame
+class MyFrame: public wxFrame
+{
+  public:
+    wxPanel *panel;
+
+    MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
+    void OnCloseWindow(wxCloseEvent& event);
+    void OnExit(wxCommandEvent& event);
+    void OnExecute(wxCommandEvent& event);
+    void OnPoke(wxCommandEvent& event);
+    void OnRequest(wxCommandEvent& event);
+DECLARE_EVENT_TABLE()
+};
+
+class MyConnection: public wxConnection
+{
+ public:
+  MyConnection();
+  ~MyConnection();
+  bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format);
+  bool OnDisconnect();
+};
+
+class MyClient: public wxClient
+{
+ public:
+  MyClient();
+  wxConnectionBase *OnMakeConnection();
+};
+
+#define CLIENT_QUIT     wxID_EXIT
+#define CLIENT_EXECUTE  2
+#define CLIENT_REQUEST  3
+#define CLIENT_POKE     4
+#define CLIENT_LISTBOX  200
diff --git a/samples/dde/client.rc b/samples/dde/client.rc
new file mode 100644
index 0000000000..74b8e3f417
--- /dev/null
+++ b/samples/dde/client.rc
@@ -0,0 +1,2 @@
+mondrian ICON "mondrian.ico"
+#include "wx/msw/wx.rc"
diff --git a/samples/dde/client.vc b/samples/dde/client.vc
new file mode 100644
index 0000000000..f52524060b
--- /dev/null
+++ b/samples/dde/client.vc
@@ -0,0 +1,20 @@
+#
+# File:		makefile.vc
+# Author:	Julian Smart
+# Created:	1999
+# Updated:	
+# Copyright:	(c) Julian Smart
+#
+# Makefile : Builds sample (VC++, WIN32)
+# Use FINAL=1 argument to nmake to build final version with no debug info.
+
+# Set WXDIR for your system
+WXDIR = $(WXWIN)
+
+PROGRAM=client
+OBJECTS = $(PROGRAM).obj
+
+!include $(WXDIR)\src\makeprog.vc
+
+client.obj: ddesetup.h
+
diff --git a/samples/dde/client.wat b/samples/dde/client.wat
new file mode 100644
index 0000000000..789db64157
--- /dev/null
+++ b/samples/dde/client.wat
@@ -0,0 +1,15 @@
+#
+# Makefile for WATCOM
+#
+# Created by Julian Smart, January 1999
+# 
+#
+
+WXDIR = $(%WXWIN)
+
+PROGRAM = client
+OBJECTS = $(PROGRAM).obj
+
+!include $(WXDIR)\src\makeprog.wat
+
+
diff --git a/samples/dde/ddesetup.h b/samples/dde/ddesetup.h
new file mode 100644
index 0000000000..7b674ecf54
--- /dev/null
+++ b/samples/dde/ddesetup.h
@@ -0,0 +1,37 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        ddesetup.h
+// Purpose:     DDE sample settings
+// Author:      Julian Smart
+// Modified by:
+// Created:     25/01/99
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+/*
+ * Adjust this before compiling, to switch between real DDE and TCP/IP
+ * implementations.
+ */
+
+// If 1, use real DDE. If 0, use TCP/IP
+#define wxUSE_DDE_FOR_SAMPLE 1
+
+#if wxUSE_DDE_FOR_SAMPLE
+
+#define wxConnection    wxDDEConnection
+#define wxServer        wxDDEServer
+#define wxClient        wxDDEClient
+
+#include <wx/dde.h>
+
+#else
+
+#define wxConnection    wxTCPConnection
+#define wxServer        wxTCPServer
+#define wxClient        wxTCPClient
+
+#include <wx/sckipc.h>
+
+#endif
+
diff --git a/samples/dde/makefile.b32 b/samples/dde/makefile.b32
new file mode 100644
index 0000000000..94a0ed2b5b
--- /dev/null
+++ b/samples/dde/makefile.b32
@@ -0,0 +1,82 @@
+#
+# File:		makefile.b32
+# Author:	Guilhem Lavaux
+# Created:	1998
+# Updated:	
+# Copyright:	(c) Guilhem Lavaux
+#
+# "%W% %G%"
+#
+# Makefile : Builds 32-bit wxSocket sample under BC++
+
+WXDIR = $(WXWIN)
+
+ZLIB = $(WXDIR)\lib\zlib.lib
+
+!include $(WXDIR)\src\makeb32.env
+
+WXLIBDIR = $(WXDIR)\lib
+WXINC = $(WXDIR)\include\msw
+WXLIB = $(WXLIBDIR)\wx32.lib
+LIBS=$(WXLIB) $(ZLIB) cw32 import32 ole2w32
+
+!if "$(FINAL)" == "0"
+LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
+OPT = -Od
+DEBUG_FLAGS= -v
+!else
+LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib
+OPT = -Od
+DEBUG_FLAGS =
+!endif
+CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
+
+.$(SRCSUFF).obj:
+	bcc32 $(CPPFLAGS) -c {$< }
+
+.c.obj:
+	bcc32 $(CPPFLAGS) -P- -c {$< }
+
+CLIENT_TARGET=client
+SERVER_TARGET=server
+CLIENT_OBJECTS=client.obj
+SERVER_OBJECTS=server.obj
+
+all:    $(CLIENT_TARGET).exe $(SERVER_TARGET).exe
+
+$(CLIENT_TARGET).exe:   $(CLIENT_OBJECTS) $(CLIENT_TARGET).res
+  tlink32 $(LINKFLAGS) @&&!
+  c0w32.obj $(CLIENT_OBJECTS)
+  $(CLIENT_TARGET)
+  nul
+  $(LIBS)
+  $(CLIENT_TARGET).def
+  $(CLIENT_TARGET).res
+!
+
+client.obj:     client.cpp
+
+$(CLIENT_TARGET).res :      $(CLIENT_TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
+    brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(CLIENT_TARGET)
+
+$(SERVER_TARGET).exe:   $(SERVER_OBJECTS) $(SERVER_TARGET).res
+  tlink32 $(LINKFLAGS) @&&!
+  c0w32.obj $(SERVER_OBJECTS)
+  $(SERVER_TARGET)
+  nul
+  $(LIBS)
+  $(SERVER_TARGET).def
+  $(SERVER_TARGET).res
+!
+
+server.obj:     server.cpp
+
+$(SERVER_TARGET).res:   $(SERVER_TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
+    brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(SERVER_TARGET)
+
+clean:
+        -erase *.obj
+        -erase *.exe
+        -erase *.res
+        -erase *.map
+        -erase *.rws
diff --git a/samples/dde/makefile.dos b/samples/dde/makefile.dos
new file mode 100644
index 0000000000..2a42833b60
--- /dev/null
+++ b/samples/dde/makefile.dos
@@ -0,0 +1,19 @@
+#
+# File:		makefile.dos
+# Author:	Julian Smart
+# Created:	1998
+# Updated:	
+#
+# Makefile : Builds 16-bit sample, VC++ 1.5
+# Use FINAL=1 argument to nmake to build final version with no debugging
+# info
+
+WXDIR = $(WXWIN)
+
+TARGET=client
+OBJECTS = $(TARGET).obj
+
+# TODO: server
+
+!include $(WXDIR)\src\makeprog.msc
+
diff --git a/samples/dde/makefile.g95 b/samples/dde/makefile.g95
new file mode 100644
index 0000000000..8139390064
--- /dev/null
+++ b/samples/dde/makefile.g95
@@ -0,0 +1,46 @@
+#
+# File:		makefile.unx
+# Author:	Julian Smart
+# Created:	1993
+# Updated:	
+# Copyright:	(c) 1993, AIAI, University of Edinburgh
+#
+# "%W% %G%"
+#
+# Makefile for server/client example (UNIX).
+
+WXDIR = ../..
+
+# All common UNIX compiler flags and options are now in
+# this central makefile.
+include $(WXDIR)/src/makeg95.env
+
+OBJECTS=$(OBJDIR)/server.$(OBJSUFF) $(OBJDIR)/server_resources.$(OBJSUFF)\
+ $(OBJDIR)/client.$(OBJSUFF) $(OBJDIR)/client_resources.$(OBJSUFF)
+
+all:	$(OBJDIR) server$(GUISUFFIX) client$(GUISUFFIX)
+
+
+$(OBJDIR):
+	mkdir $(OBJDIR)
+
+server$(GUISUFFIX): $(OBJDIR)/server.$(OBJSUFF) $(OBJDIR)/server_resources.$(OBJSUFF) $(WXLIB)
+	$(CC) $(LDFLAGS) -o server$(GUISUFFIX)$(EXESUFF) $(OBJDIR)/server.$(OBJSUFF) $(OBJDIR)/server_resources.$(OBJSUFF) $(LDLIBS)
+
+$(OBJDIR)/server.$(OBJSUFF):        server.$(SRCSUFF) server.h
+	$(CC) -c $(CPPFLAGS) -o $@ server.$(SRCSUFF)
+
+client$(GUISUFFIX): $(OBJDIR)/client.$(OBJSUFF) $(OBJDIR)/client_resources.$(OBJSUFF) $(WXLIB)
+	$(CC) $(LDFLAGS) -o client$(GUISUFFIX)$(EXESUFF) $(OBJDIR)/client.$(OBJSUFF) $(OBJDIR)/client_resources.$(OBJSUFF) $(LDLIBS)
+
+$(OBJDIR)/client.$(OBJSUFF):        client.$(SRCSUFF) client.h
+	$(CC) -c $(CPPFLAGS) -o $@ client.$(SRCSUFF)
+        
+$(OBJDIR)/server_resources.o:  server.rc
+	$(RESCOMP) -i server.rc -o $(OBJDIR)/server_resources.o $(RESFLAGS)
+
+$(OBJDIR)/client_resources.o:  client.rc
+	$(RESCOMP) -i client.rc -o $(OBJDIR)/client_resources.o $(RESFLAGS)
+
+clean:
+	rm -f $(OBJECTS) server$(GUISUFFIX).exe client$(GUISUFFIX).exe core *.rsc *.res
diff --git a/samples/dde/makefile.vc b/samples/dde/makefile.vc
new file mode 100644
index 0000000000..3864d7dd9d
--- /dev/null
+++ b/samples/dde/makefile.vc
@@ -0,0 +1,20 @@
+#
+# File:		makefile.vc
+# Author:	Julian Smart
+# Created:	1999
+# Updated:	
+# Copyright:	(c) Julian Smart
+#
+# Makefile : Builds sample (VC++, WIN32)
+# Use FINAL=1 argument to nmake to build final version with no debug info.
+
+!include $(WXWIN)/src/makevc.env
+
+all:
+    nmake -f server.vc FINAL=$(FINAL)
+    nmake -f client.vc FINAL=$(FINAL)
+
+clean:
+    nmake -f server.vc clean
+    nmake -f client.vc clean
+
diff --git a/samples/dde/mondrian.ico b/samples/dde/mondrian.ico
new file mode 100644
index 0000000000000000000000000000000000000000..2310c5d275a87af295d5ea8dc79ea417a5e74c53
GIT binary patch
literal 766
zcmZQzU<5)11px*Sc)`TLAO@s0fLH;D9e|jTfdxnc0Z<M**w4TKL=5})Lnt5#WHKB$
zaDbtqp#doIAB-6O{|B*v7zjZ^AOa2W|NsACHyAJ}De?dRKnp(HN~rljcR;{k;{zQE
i@;}UZ|9Q?Fpp*~yJCwmWbLIrN`9Qm9%}2L?p!oo$cZ4ed

literal 0
HcmV?d00001

diff --git a/samples/dde/mondrian.xpm b/samples/dde/mondrian.xpm
new file mode 100644
index 0000000000..409f27a843
--- /dev/null
+++ b/samples/dde/mondrian.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char *mondrian_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 6 1",
+"  c Black",
+". c Blue",
+"X c #00bf00",
+"o c Red",
+"O c Yellow",
+"+ c Gray100",
+/* pixels */
+"                                ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+"                                ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++      ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++                    ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+"                                "
+};
diff --git a/samples/dde/server.cpp b/samples/dde/server.cpp
new file mode 100644
index 0000000000..864c68afa7
--- /dev/null
+++ b/samples/dde/server.cpp
@@ -0,0 +1,196 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        server.cpp
+// Purpose:     DDE sample: server
+// Author:      Julian Smart
+// Modified by:
+// Created:     25/01/99
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+// Settings common to both executables: determines whether
+// we're using TCP/IP or real DDE.
+
+#include "ddesetup.h"
+
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#include "mondrian.xpm"
+#endif
+
+#include "server.h"
+
+MyFrame *frame = NULL;
+
+IMPLEMENT_APP(MyApp)
+
+char ipc_buffer[4000];
+MyConnection *the_connection = NULL;
+MyServer *my_server ;
+
+bool MyApp::OnInit()
+{
+  // Create the main frame window
+  frame = new MyFrame(NULL, "Server", wxDefaultPosition, wxSize(400, 500));
+
+  frame->CreateStatusBar();
+
+  // Give it an icon
+  frame->SetIcon(wxICON(mondrian));
+
+  // Make a menubar
+  wxMenu *file_menu = new wxMenu;
+
+  file_menu->Append(SERVER_QUIT, "&Exit");
+
+  wxMenuBar *menu_bar = new wxMenuBar;
+
+  menu_bar->Append(file_menu, "&File");
+
+  // Associate the menu bar with the frame
+  frame->SetMenuBar(menu_bar);
+
+  // Make a panel
+  frame->panel = new wxPanel(frame, 0, 0, 400, 250);
+  wxListBox *list = new wxListBox(frame->panel, SERVER_LISTBOX,
+                                  wxPoint(5, 5), wxSize(150, 120));
+  list->Append("Apple");
+  list->Append("Pear");
+  list->Append("Orange");
+  list->Append("Banana");
+  list->Append("Fruit");
+
+  frame->panel->Fit();
+  frame->Fit();
+
+  wxString server_name = "4242";
+  if (argc > 1)
+    server_name = argv[1];
+
+  // Create a new server
+  my_server = new MyServer;
+  my_server->Create(server_name);
+
+  frame->Show(TRUE);
+
+  return TRUE;
+}
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+    EVT_MENU(SERVER_QUIT, MyFrame::OnExit)
+    EVT_CLOSE(MyFrame::OnCloseWindow)
+    EVT_LISTBOX(SERVER_LISTBOX, MyFrame::OnListBoxClick)
+END_EVENT_TABLE()
+
+// Define my frame constructor
+MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
+  wxFrame(frame, -1, title, pos, size)
+{
+  panel = NULL;
+}
+
+void MyFrame::OnExit(wxCommandEvent& event)
+{
+    if (my_server)
+        delete my_server;
+    this->Destroy();
+}
+
+// Set the client process's listbox to this item
+void MyFrame::OnListBoxClick(wxCommandEvent& event)
+{
+    wxListBox* listBox = (wxListBox*) panel->FindWindow(SERVER_LISTBOX);
+    if (listBox)
+    {
+        wxString value = listBox->GetStringSelection();
+        if (the_connection)
+        {
+            the_connection->Advise("Item", (char*) (const char*) value);
+        }
+    }
+}
+
+void MyFrame::OnCloseWindow(wxCloseEvent& event)
+{
+    if (my_server)
+        delete my_server;
+    this->Destroy();
+}
+
+BEGIN_EVENT_TABLE(IPCDialogBox, wxDialog)
+    EVT_BUTTON(SERVER_QUIT_BUTTON, IPCDialogBox::OnQuit)
+END_EVENT_TABLE()
+
+IPCDialogBox::IPCDialogBox(wxFrame *parent, const wxString& title,
+                         const wxPoint& pos, const wxSize& size, MyConnection *the_connection):
+                     wxDialog(parent, -1, title, pos, size)
+{
+  connection = the_connection;
+  (void)new wxButton(this, SERVER_QUIT_BUTTON, "Quit this connection", wxPoint(5, 5));
+  Fit();
+}
+
+void IPCDialogBox::OnQuit(wxCommandEvent& event)
+{
+  connection->Disconnect();
+  delete connection;
+}
+
+wxConnectionBase *MyServer::OnAcceptConnection(const wxString& topic)
+{
+  if (strcmp(topic, "STDIO") != 0 && strcmp(topic, "IPC TEST") == 0)
+    return new MyConnection(ipc_buffer, 4000);
+  else
+    return NULL;
+}
+
+MyConnection::MyConnection(char *buf, int size):wxConnection(buf, size)
+{
+  dialog = new IPCDialogBox(frame, "Connection", wxPoint(100, 100), wxSize(500, 500), this);
+  dialog->Show(TRUE);
+  the_connection = this;
+}
+
+MyConnection::~MyConnection(void)
+{
+  dialog->Destroy();
+  the_connection = NULL;
+}
+
+bool MyConnection::OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format)
+{
+  char buf[300];
+  sprintf(buf, "Execute command: %s", data);
+  frame->SetStatusText(buf);
+  return TRUE;
+}
+
+bool MyConnection::OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format)
+{
+  char buf[300];
+  sprintf(buf, "Poke command: %s", data);
+  frame->SetStatusText(buf);
+  return TRUE;
+}
+
+char *MyConnection::OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format)
+{
+  return "Here, have your data, client!";
+}
+
+bool MyConnection::OnStartAdvise(const wxString& topic, const wxString& item)
+{
+    return TRUE;
+}
+
diff --git a/samples/dde/server.def b/samples/dde/server.def
new file mode 100644
index 0000000000..21027a5c01
--- /dev/null
+++ b/samples/dde/server.def
@@ -0,0 +1,8 @@
+NAME         Server
+DESCRIPTION  'Server'
+EXETYPE      WINDOWS
+STUB         'WINSTUB.EXE'
+CODE         PRELOAD MOVEABLE DISCARDABLE
+DATA         PRELOAD MOVEABLE MULTIPLE
+HEAPSIZE     4096
+STACKSIZE    8192
diff --git a/samples/dde/server.h b/samples/dde/server.h
new file mode 100644
index 0000000000..81aa31697b
--- /dev/null
+++ b/samples/dde/server.h
@@ -0,0 +1,70 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        server.h
+// Purpose:     DDE sample: server
+// Author:      Julian Smart
+// Modified by:
+// Created:     25/01/99
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// Define a new application
+class MyApp: public wxApp
+{
+  public:
+    bool OnInit();
+};
+
+DECLARE_APP(MyApp)
+
+// Define a new frame
+class MyFrame: public wxFrame
+{
+  public:
+    wxPanel *panel;
+
+    MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
+
+    void OnCloseWindow(wxCloseEvent& event);
+    void OnExit(wxCommandEvent& event);
+    void OnListBoxClick(wxCommandEvent& event);
+DECLARE_EVENT_TABLE()
+};
+
+class IPCDialogBox;
+class MyConnection: public wxConnection
+{
+ public:
+  IPCDialogBox *dialog;
+
+  MyConnection(char *buf, int size);
+  ~MyConnection();
+
+  bool OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format);
+  char *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
+  bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format);
+  bool OnStartAdvise(const wxString& topic, const wxString& item);
+};
+
+class MyServer: public wxServer
+{
+public:
+    wxConnectionBase *OnAcceptConnection(const wxString& topic);
+};
+
+class IPCDialogBox: public wxDialog
+{
+public:
+    MyConnection *connection;
+    IPCDialogBox(wxFrame *parent, const wxString& title,
+                         const wxPoint& pos, const wxSize& size, MyConnection *the_connection);
+
+    void OnQuit(wxCommandEvent& event);
+
+DECLARE_EVENT_TABLE()
+};
+
+#define SERVER_QUIT         wxID_EXIT
+#define SERVER_LISTBOX      500
+#define SERVER_QUIT_BUTTON  501
diff --git a/samples/dde/server.rc b/samples/dde/server.rc
new file mode 100644
index 0000000000..7655c62a4c
--- /dev/null
+++ b/samples/dde/server.rc
@@ -0,0 +1,3 @@
+mondrian ICON "mondrian.ico"
+#include "wx/msw/wx.rc"
+
diff --git a/samples/dde/server.vc b/samples/dde/server.vc
new file mode 100644
index 0000000000..6167edfb7d
--- /dev/null
+++ b/samples/dde/server.vc
@@ -0,0 +1,20 @@
+#
+# File:		makefile.vc
+# Author:	Julian Smart
+# Created:	1999
+# Updated:	
+# Copyright:	(c) Julian Smart
+#
+# Makefile : Builds sample (VC++, WIN32)
+# Use FINAL=1 argument to nmake to build final version with no debug info.
+
+# Set WXDIR for your system
+WXDIR = $(WXWIN)
+
+PROGRAM=server
+OBJECTS = $(PROGRAM).obj
+
+!include $(WXDIR)\src\makeprog.vc
+
+server.obj: ddesetup.h
+
diff --git a/samples/dde/server.wat b/samples/dde/server.wat
new file mode 100644
index 0000000000..2acfdf1115
--- /dev/null
+++ b/samples/dde/server.wat
@@ -0,0 +1,15 @@
+#
+# Makefile for WATCOM
+#
+# Created by Julian Smart, January 1999
+# 
+#
+
+WXDIR = $(%WXWIN)
+
+PROGRAM = server
+OBJECTS = $(PROGRAM).obj
+
+!include $(WXDIR)\src\makeprog.wat
+
+
diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp
index 0003b97093..59511a065b 100644
--- a/src/common/sckipc.cpp
+++ b/src/common/sckipc.cpp
@@ -188,6 +188,10 @@ wxTCPConnection::wxTCPConnection (void)
 {
 }
 
+wxTCPConnection::wxTCPConnection(char *buffer, int size)
+{
+}
+
 wxTCPConnection::~wxTCPConnection (void)
 {
   wxDELETE(m_sock);
diff --git a/src/generic/helpxlp.cpp b/src/generic/helpxlp.cpp
index 4fd7ed0a2f..13d43fbb63 100644
--- a/src/generic/helpxlp.cpp
+++ b/src/generic/helpxlp.cpp
@@ -97,7 +97,6 @@ bool wxXLPHelpController::Initialize(const wxString& filename, int server)
 
   helpFile = filename;
   helpServer = server;
-  wxIPCInitialize();
   return TRUE;
 }
 
diff --git a/src/makefile.vc b/src/makefile.vc
index 5ad7dee96a..ca8985bf2e 100644
--- a/src/makefile.vc
+++ b/src/makefile.vc
@@ -20,16 +20,16 @@ THISDIR=$(WXWIN)\src
 
 all:
     cd msw
-    nmake -f makefile.nt
+    nmake -f makefile.vc
     cd $(THISDIR)
 
 clean:
     cd msw
-    nmake -f makefile.nt clean
+    nmake -f makefile.vc clean
     cd $(THISDIR)
 
 cleanall:
     cd msw
-    nmake -f makefile.nt cleanall
+    nmake -f makefile.vc cleanall
     cd $(THISDIR)
 
diff --git a/src/makevc.env b/src/makevc.env
index 01d08574fd..773d9ae719 100644
--- a/src/makevc.env
+++ b/src/makevc.env
@@ -36,7 +36,7 @@ WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER
 #WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\
 # comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib # libci.lib # libci.lib required for VC++ 4.2
 WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\
- comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib # libci.lib # libci.lib required for VC++ 4.2
+ comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib # libci.lib # libci.lib required for VC++ 4.2
 
 # Change this to your WXWIN directory
 WXDIR=$(WXWIN)
diff --git a/src/png/makefile.vc b/src/png/makefile.vc
index a4c8b19d4b..9094b9ee13 100644
--- a/src/png/makefile.vc
+++ b/src/png/makefile.vc
@@ -1,5 +1,5 @@
 #
-# File:		makefile.nt
+# File:		makefile.vc
 # Author:	Julian Smart
 # Created:	1993
 # Updated:	
diff --git a/src/xpm/parse.c b/src/xpm/parse.c
index 17f8ed27f6..74bb479fe9 100644
--- a/src/xpm/parse.c
+++ b/src/xpm/parse.c
@@ -47,6 +47,7 @@
 
 #ifdef sun
 #ifdef SVR4
+#define __ORIGINAL_XORG_CODE
 #include <X11/Xfuncs.h> /* bzero, bcopy */
 #endif
 #endif
diff --git a/utils/tex2rtf/src/makefile.vc b/utils/tex2rtf/src/makefile.vc
index a3bf628330..fb16a0e098 100644
--- a/utils/tex2rtf/src/makefile.vc
+++ b/utils/tex2rtf/src/makefile.vc
@@ -23,7 +23,7 @@ all:    tex2rtf.exe
 
 wx:
         cd $(WXDIR)\src\msw
-        nmake -f makefile.nt
+        nmake -f makefile.vc
         cd $(TEX2RTFDIR)\src
 
 $(PROGRAM).exe:      $(WXLIB) $(OBJECTS) $(PROGRAM).res
-- 
2.50.0

