]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dde.cpp
wxGetFullHostName() implemented - it doesn't work though (and won't even
[wxWidgets.git] / src / msw / dde.cpp
index 8ee90711604289f4bee751057018a444f4a9af37..d8fe4dfa5a7c7abe35a34fe58c2a8fa9c26c126d 100644 (file)
 #include "wx/app.h"
 #endif
 
-#include "wx/msw/private.h"
+#include "wx/module.h"
 #include "wx/dde.h"
 
+#include "wx/msw/private.h"
+#include <windows.h>
+#include <ddeml.h>
+
 #ifndef __TWIN32__
 #ifdef __GNUWIN32__
 #include "wx/msw/gnuwin32/extra.h"
 #endif
 #endif
 
-#include <windows.h>
-#include <ddeml.h>
 #include <string.h>
 
 #ifdef __WIN32__
@@ -120,6 +122,21 @@ void wxDDECleanUp()
     delete [] DDEDefaultIPCBuffer ;
 }
 
+// A module to allow DDE initialization/cleanup
+// without calling these functions from app.cpp or from
+// the user's application.
+
+class wxDDEModule: public wxModule
+{
+DECLARE_DYNAMIC_CLASS(wxDDEModule)
+public:
+    wxDDEModule() {}
+    bool OnInit() { wxDDEInitialize(); return TRUE; };
+    void OnExit() { wxDDECleanUp(); };
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxDDEModule, wxModule)
+
 // Global find connection
 static wxDDEConnection *DDEFindConnection(HCONV hConv)
 {