]>
git.saurik.com Git - wxWidgets.git/blob - samples/dde/server.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: DDE sample: server
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // Define a new application
13 class MyApp
: public wxApp
22 class MyFrame
: public wxFrame
27 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
29 void OnCloseWindow(wxCloseEvent
& event
);
30 void OnExit(wxCommandEvent
& event
);
31 void OnListBoxClick(wxCommandEvent
& event
);
36 class MyConnection
: public wxConnection
41 MyConnection(char *buf
, int size
);
44 bool OnExecute(const wxString
& topic
, char *data
, int size
, wxIPCFormat format
);
45 char *OnRequest(const wxString
& topic
, const wxString
& item
, int *size
, wxIPCFormat format
);
46 bool OnPoke(const wxString
& topic
, const wxString
& item
, char *data
, int size
, wxIPCFormat format
);
47 bool OnStartAdvise(const wxString
& topic
, const wxString
& item
);
50 class MyServer
: public wxServer
53 wxConnectionBase
*OnAcceptConnection(const wxString
& topic
);
56 class IPCDialogBox
: public wxDialog
59 MyConnection
*connection
;
60 IPCDialogBox(wxFrame
*parent
, const wxString
& title
,
61 const wxPoint
& pos
, const wxSize
& size
, MyConnection
*the_connection
);
63 void OnQuit(wxCommandEvent
& event
);
68 #define SERVER_QUIT wxID_EXIT
69 #define SERVER_LISTBOX 500
70 #define SERVER_QUIT_BUTTON 501