/////////////////////////////////////////////////////////////////////////////// // // (c) Digi International Inc. 2002. All Rights Reserved // // Digi provides this document "as is," without warranty of any kind, // either expressed or implied, including, but not limited to, the implied // warranties of fitness or merchantability for a particular purpose. Digi // may make improvements and/or changes in this document or in the product(s) // and/or the program(s) described in this document at any time. // // This document could include technical inaccuracies or typographical errors. // Changes are periodically made to the information herein; these changes may // be incorporated in new editions of the publication. // // Digi International Inc. // 11001 Bren Road East // Minnetonka, MN 55343, USA // Tel: +1 (952) 912-3444 // Fax: +1 (952) 912-4952 // http://www.digi.com/ // /////////////////////////////////////////////////////////////////////////////// // MySocket.h : header file defining CMySocket socket communication class // #if !defined(AFX_MYSOCKET_H__BF0745D3_2BA6_401B_B3B0_6671C5E9D72B__INCLUDED_) #define AFX_MYSOCKET_H__BF0745D3_2BA6_401B_B3B0_6671C5E9D72B__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Define the windows messages this socket class will use to // notify the owner of the socket that something has happened // // See "INFO: Use ON_MESSAGE() Macro to Map Less-Common Messages" in MSDN // for more information on processing user defined messages #define WM_MYSOCKET_ONACCEPT (WM_USER + 1) // afx_msg LRESULT OnMySocketAccept(WPARAM wParam, LPARAM lParam); // ON_MESSAGE(WM_MYSOCKET_ONACCEPT, OnMySocketAccept) #define WM_MYSOCKET_ONCONNECT (WM_USER + 2) // afx_msg LRESULT OnMySocketConnect(WPARAM wParam, LPARAM lParam); // ON_MESSAGE(WM_MYSOCKET_ONCONNECT, OnMySocketConnect) #define WM_MYSOCKET_ONRECEIVE (WM_USER + 3) // afx_msg LRESULT OnMySocketReceive(WPARAM wParam, LPARAM lParam); // ON_MESSAGE(WM_MYSOCKET_ONRECEIVE, OnMySocketReceive) #define WM_MYSOCKET_ONCLOSE (WM_USER + 4) // afx_msg LRESULT OnMySocketClose(WPARAM wParam, LPARAM lParam); // ON_MESSAGE(WM_MYSOCKET_ONCLOSE, OnMySocketClose) ///////////////////////////////////////////////////////////////////////////// // CMySocket command target class CMySocket : public CAsyncSocket { // Attributes public: // Window handle to the owner of a CMySocket object. // Used to relay the user-defined messages above. HWND m_Hwnd; // Operations public: CMySocket(); virtual ~CMySocket(); // Overrides public: // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMySocket) public: virtual void OnAccept(int nErrorCode); virtual void OnConnect(int nErrorCode); virtual void OnReceive(int nErrorCode); virtual void OnClose(int nErrorCode); //}}AFX_VIRTUAL // Generated message map functions //{{AFX_MSG(CMySocket) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG // Implementation protected: }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYSOCKET_H__BF0745D3_2BA6_401B_B3B0_6671C5E9D72B__INCLUDED_)