X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57c208c5759da71a637f0f0f5b7d3dc3eda09c02..e146b8c8bf449e2264ac3edc6a0228585c619dd1:/src/msw/dde.cpp 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) {