X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57c208c5759da71a637f0f0f5b7d3dc3eda09c02..c6eba8f8b204b0d722db0007e3e0d5e2d2d20085:/src/msw/dde.cpp?ds=sidebyside diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index 8ee9071160..d8fe4dfa5a 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -31,17 +31,19 @@ #include "wx/app.h" #endif -#include "wx/msw/private.h" +#include "wx/module.h" #include "wx/dde.h" +#include "wx/msw/private.h" +#include +#include + #ifndef __TWIN32__ #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" #endif #endif -#include -#include #include #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) {