Added dde sample; added docs/index.htm
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -10,7 +10,9 @@ docs/todo.txt
|
|||||||
docs/licence.txt
|
docs/licence.txt
|
||||||
docs/symbols.txt
|
docs/symbols.txt
|
||||||
docs/bugs.txt
|
docs/bugs.txt
|
||||||
docs/*.html
|
docs/*.htm
|
||||||
|
docs/html/*.htm
|
||||||
|
docs/html/*.gif
|
||||||
|
|
||||||
src/*.inc
|
src/*.inc
|
||||||
src/mkdir
|
src/mkdir
|
||||||
@@ -638,3 +640,19 @@ samples/thread/*.png
|
|||||||
samples/thread/*.ico
|
samples/thread/*.ico
|
||||||
samples/thread/*.txt
|
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
|
||||||
|
|
||||||
|
@@ -25,7 +25,8 @@ wxMotif:
|
|||||||
General:
|
General:
|
||||||
|
|
||||||
- wxBusyCursor class added.
|
- wxBusyCursor class added.
|
||||||
- More doc improvements.
|
- Added samples/dde.
|
||||||
|
- More doc improvements, incl. expanding docs/html/index.htm.
|
||||||
|
|
||||||
Beta 2, January 1999
|
Beta 2, January 1999
|
||||||
--------------------
|
--------------------
|
||||||
|
@@ -24,11 +24,22 @@
|
|||||||
|
|
||||||
<P>
|
<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,
|
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>
|
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>
|
<ul>
|
||||||
<li>ReadMe: <a href="../readme.txt"><b>General ReadMe</b></a>,
|
<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
|
<li>List of <a href="../symbols.txt">preprocessor symbols</a> used in wxWindows
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>wxWindows manuals</h3>
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a name="manuals">wxWindows manuals</a></h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="wx/wx.htm">Reference Manual</a>
|
<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="dialoged/dlged.htm">Dialog Editor</a>
|
||||||
<li><a href="proplist/prop.htm">Property List Classes</a>
|
<li><a href="proplist/prop.htm">Property List Classes</a>
|
||||||
<li><a href="wxtree/tree.htm">wxTreeLayout</a>
|
<li><a href="wxtree/tree.htm">wxTreeLayout</a>
|
||||||
<li><a href="odbc/odbc.htm">Remstar ODBC Classes</a>
|
<li><a href="odbc/odbc.htm">Remstar ODBC Classes</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Third-party tools</h3>
|
<hr>
|
||||||
|
|
||||||
|
<h3><a name="thirdparty">Third-party tools</a></h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="gettext/gettext.htm">gettext manual</a>
|
<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>
|
<li><a href="gettext/msgfmt.htm">msgfmt manual</a>
|
||||||
</ul>
|
</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>
|
</font>
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
|
37
docs/index.htm
Normal file
37
docs/index.htm
Normal file
@@ -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>
|
||||||
|
|
@@ -23,14 +23,9 @@ COMPILING USING CONFIGURE
|
|||||||
in this directory):
|
in this directory):
|
||||||
|
|
||||||
# Make wxMotif using the configure system
|
# Make wxMotif using the configure system
|
||||||
chmod a+x install/unix/config.sub
|
chmod a+x configure config.sub setup/general/* config.guess setup/shared/*
|
||||||
install/unix/setup/general/* \
|
./configure --with-shared --with-motif --with-debug_flag \
|
||||||
install/unix/config.guess install/unix/setup/shared/*
|
|
||||||
cd install/unix
|
|
||||||
autoconf && ./configure --with-shared --with-motif --with-debug_flag \
|
|
||||||
--with-debug_info --without-threads
|
--with-debug_info --without-threads
|
||||||
cd ../..
|
|
||||||
make makefiles
|
|
||||||
make
|
make
|
||||||
|
|
||||||
COMPILING USING MAKEFILES
|
COMPILING USING MAKEFILES
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
# Make wxMotif using the configure system
|
# 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/*
|
chmod a+x configure config.sub setup/general/* config.guess setup/shared/*
|
||||||
cd install/unix
|
./configure --with-shared --with-motif --with-debug_flag --with-debug_info --without-threads
|
||||||
autoconf && ./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads
|
|
||||||
cd ../..
|
|
||||||
make makefiles
|
|
||||||
make
|
make
|
||||||
|
|
||||||
|
@@ -15,6 +15,9 @@ tree controls on Unix, they are emulated.
|
|||||||
A detailed 700-page reference manual is supplied in HTML, PDF and
|
A detailed 700-page reference manual is supplied in HTML, PDF and
|
||||||
Windows Help form.
|
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
|
Platforms supported
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
@@ -16,7 +16,9 @@ Please see also:
|
|||||||
|
|
||||||
- Documentation: mention include files with each class.
|
- 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:
|
- Get Karsten to remove trashed CVS files:
|
||||||
|
|
||||||
|
@@ -149,14 +149,5 @@ class WXDLLEXPORT wxDDEClient: public wxClientBase
|
|||||||
void WXDLLEXPORT wxDDEInitialize();
|
void WXDLLEXPORT wxDDEInitialize();
|
||||||
void WXDLLEXPORT wxDDECleanUp();
|
void WXDLLEXPORT wxDDECleanUp();
|
||||||
|
|
||||||
// Compatibility
|
|
||||||
#if WXWIN_COMPATIBILITY
|
|
||||||
#define wxServer wxDDEServer
|
|
||||||
#define wxClient wxDDEClient
|
|
||||||
#define wxConnection wxDDEConnection
|
|
||||||
#define wxIPCInitialize wxDDEInitialize
|
|
||||||
#define wxIPCCleanUp wxDDECleanUp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_DDE_H_
|
// _WX_DDE_H_
|
||||||
|
1
samples/dde/Makefile
Normal file
1
samples/dde/Makefile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include ../../setup/general/makeapp
|
28
samples/dde/Makefile.in
Normal file
28
samples/dde/Makefile.in
Normal file
@@ -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
|
211
samples/dde/client.cpp
Normal file
211
samples/dde/client.cpp
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
|
8
samples/dde/client.def
Normal file
8
samples/dde/client.def
Normal file
@@ -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
|
55
samples/dde/client.h
Normal file
55
samples/dde/client.h
Normal file
@@ -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
|
2
samples/dde/client.rc
Normal file
2
samples/dde/client.rc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
mondrian ICON "mondrian.ico"
|
||||||
|
#include "wx/msw/wx.rc"
|
20
samples/dde/client.vc
Normal file
20
samples/dde/client.vc
Normal file
@@ -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
|
||||||
|
|
15
samples/dde/client.wat
Normal file
15
samples/dde/client.wat
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
37
samples/dde/ddesetup.h
Normal file
37
samples/dde/ddesetup.h
Normal file
@@ -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
|
||||||
|
|
82
samples/dde/makefile.b32
Normal file
82
samples/dde/makefile.b32
Normal file
@@ -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
|
19
samples/dde/makefile.dos
Normal file
19
samples/dde/makefile.dos
Normal file
@@ -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
|
||||||
|
|
46
samples/dde/makefile.g95
Normal file
46
samples/dde/makefile.g95
Normal file
@@ -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
|
20
samples/dde/makefile.vc
Normal file
20
samples/dde/makefile.vc
Normal file
@@ -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
|
||||||
|
|
BIN
samples/dde/mondrian.ico
Normal file
BIN
samples/dde/mondrian.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
44
samples/dde/mondrian.xpm
Normal file
44
samples/dde/mondrian.xpm
Normal file
@@ -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 ++++ ",
|
||||||
|
" "
|
||||||
|
};
|
196
samples/dde/server.cpp
Normal file
196
samples/dde/server.cpp
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
|
8
samples/dde/server.def
Normal file
8
samples/dde/server.def
Normal file
@@ -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
|
70
samples/dde/server.h
Normal file
70
samples/dde/server.h
Normal file
@@ -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
|
3
samples/dde/server.rc
Normal file
3
samples/dde/server.rc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
mondrian ICON "mondrian.ico"
|
||||||
|
#include "wx/msw/wx.rc"
|
||||||
|
|
20
samples/dde/server.vc
Normal file
20
samples/dde/server.vc
Normal file
@@ -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
|
||||||
|
|
15
samples/dde/server.wat
Normal file
15
samples/dde/server.wat
Normal file
@@ -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
|
||||||
|
|
||||||
|
|
@@ -188,6 +188,10 @@ wxTCPConnection::wxTCPConnection (void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxTCPConnection::wxTCPConnection(char *buffer, int size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
wxTCPConnection::~wxTCPConnection (void)
|
wxTCPConnection::~wxTCPConnection (void)
|
||||||
{
|
{
|
||||||
wxDELETE(m_sock);
|
wxDELETE(m_sock);
|
||||||
|
@@ -97,7 +97,6 @@ bool wxXLPHelpController::Initialize(const wxString& filename, int server)
|
|||||||
|
|
||||||
helpFile = filename;
|
helpFile = filename;
|
||||||
helpServer = server;
|
helpServer = server;
|
||||||
wxIPCInitialize();
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,16 +20,16 @@ THISDIR=$(WXWIN)\src
|
|||||||
|
|
||||||
all:
|
all:
|
||||||
cd msw
|
cd msw
|
||||||
nmake -f makefile.nt
|
nmake -f makefile.vc
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd msw
|
cd msw
|
||||||
nmake -f makefile.nt clean
|
nmake -f makefile.vc clean
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
cleanall:
|
cleanall:
|
||||||
cd msw
|
cd msw
|
||||||
nmake -f makefile.nt cleanall
|
nmake -f makefile.vc cleanall
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
@@ -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\
|
#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
|
# 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\
|
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
|
# Change this to your WXWIN directory
|
||||||
WXDIR=$(WXWIN)
|
WXDIR=$(WXWIN)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# File: makefile.nt
|
# File: makefile.vc
|
||||||
# Author: Julian Smart
|
# Author: Julian Smart
|
||||||
# Created: 1993
|
# Created: 1993
|
||||||
# Updated:
|
# Updated:
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
#ifdef sun
|
#ifdef sun
|
||||||
#ifdef SVR4
|
#ifdef SVR4
|
||||||
|
#define __ORIGINAL_XORG_CODE
|
||||||
#include <X11/Xfuncs.h> /* bzero, bcopy */
|
#include <X11/Xfuncs.h> /* bzero, bcopy */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@@ -23,7 +23,7 @@ all: tex2rtf.exe
|
|||||||
|
|
||||||
wx:
|
wx:
|
||||||
cd $(WXDIR)\src\msw
|
cd $(WXDIR)\src\msw
|
||||||
nmake -f makefile.nt
|
nmake -f makefile.vc
|
||||||
cd $(TEX2RTFDIR)\src
|
cd $(TEX2RTFDIR)\src
|
||||||
|
|
||||||
$(PROGRAM).exe: $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
$(PROGRAM).exe: $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||||
|
Reference in New Issue
Block a user