X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ef6a930daefddf6bb39fefbea0baaed09071342..ed880dd448d6904a9749eb4653d2ba2fe3350b44:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index d6919eb2f0..d8c728b137 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -89,6 +89,7 @@ ///////////////////////////////////////////////////////////////////////////// // wxSocket headers ///////////////////////////////////////////////////////////////////////////// +#include "wx/module.h" #define WXSOCK_INTERNAL #include "wx/sckaddr.h" #include "wx/socket.h" @@ -153,6 +154,17 @@ int PASCAL FAR __WSAFDIsSet(SOCKET fd, fd_set FAR *set) // Some patch ///// END ///////////////////////////////////////////////////////////////////////////// +// -------------------------------------------------------------- +// Module +// -------------------------------------------------------------- +class wxSocketModule: public wxModule { + DECLARE_DYNAMIC_CLASS(wxSocketModule) +public: + wxSocketModule() {} + bool OnInit(); + void OnExit(); +}; + // -------------------------------------------------------------- // ClassInfos // -------------------------------------------------------------- @@ -162,6 +174,7 @@ IMPLEMENT_CLASS(wxSocketServer, wxSocketBase) IMPLEMENT_CLASS(wxSocketClient, wxSocketBase) IMPLEMENT_CLASS(wxSocketHandler, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxSocketEvent, wxEvent) +IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule) #endif class wxSockWakeUp : public wxTimer { @@ -1293,6 +1306,11 @@ extern char wxPanelClassName[]; LRESULT APIENTRY _EXPORT wxSocketHandlerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + if(message==WM_DESTROY) + { + ::SetWindowLong(hWnd, GWL_WNDPROC, (LONG) DefWindowProc); + return DefWindowProc(hWnd, message, wParam, lParam); + } wxSocketHandler *h_sock = (wxSocketHandler *)GetWindowLong(hWnd, GWL_USERDATA); wxNode *node = h_sock->smsg_list->Find(message); wxSocketBase *sock; @@ -1543,5 +1561,15 @@ HWND wxSocketHandler::GetHWND() const #endif +bool wxSocketModule::OnInit() { + wxSocketHandler::master = new wxSocketHandler(); + return TRUE; +} + +void wxSocketModule::OnExit() { + delete wxSocketHandler::master; + wxSocketHandler::master = NULL; +} + #endif // __WXSTUBS__