⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientdlg.h

📁 本书通过实例介绍了嵌入式编程的方法与技巧书中例子具有实用性
💻 H
字号:
#if !defined(AFX_CLIENTDLG_H__8068D458_3CAB_11D4_8ECB_00805FBDCBE4__INCLUDED_)
#define AFX_CLIENTDLG_H__8068D458_3CAB_11D4_8ECB_00805FBDCBE4__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// CClientDlg dialog
#include "vtWave.h"
class CClientDlg : public CDialog
{
// Construction
public:
CClientDlg(CWnd* pParent = NULL);	// standard constructor
// Dialog Data
//{{AFX_DATA(CClientDlg)
enum { IDD = IDD_TALKCLIENT_DIALOG };
CButton	m_btnConnect;                  // "Connect" Button 
CButton	m_chkVoice;                    // "Voice" Radio Button 
CEdit	m_editUserName;      // "User name" edit box 
CEdit	m_editServer;        // " Server" edit box
CComboBox	m_ComBoProts; // The ComboBox for the network protocols
CComboBox	m_ComBoTalker;// The ComboBox for the users name list 
CprogressCtrl m_progctrlSend;// Indicator of incoming voice message
CprogressCtrl m_progctrlRecv;// Indicator of outgoing voice message
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CClientDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CClientDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg LONG OnVTDataReady(WPARAM wparam, LPARAM lparam);
afx_msg LONG OnVTReadyForWrite(WPARAM wparam, LPARAM lparam);
afx_msg LONG OnRecordEvent(WPARAM wparam, LPARAM lparam);
afx_msg LONG OnPlayEvent(WPARAM wparam, LPARAM lparam);
afx_msg void OnChangeEditname();
afx_msg void OnChangeEditserver();
afx_msg void OnSelchangeCombprot();
afx_msg void OnSelchangeCombchatter();
afx_msg void OnBtnconnect();
afx_msg void OnBtndisconnect();
afx_msg void OnChkvoice();
afx_msg void OnClose();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
BOOL InitProtocols(void);
BOOL InitSockets(int iProtIndex);
void DoConnection(BOOL bTrue);
void EnableTalking(BOOL bTrue);
void ParseMsgData(void);
private:
VTSOCKET      m_MySock;     // The socket in client side
SOCKADDR_IPX  m_IPXAddr;    // The socket address for IPX
char   m_szSendBuf[VT_MAX];     // The buffer for sending message
char   m_szRecvBuf[VT_MAX];     // The buffer for receiving message
char   m_lpPeerName[16];        // The peer taker name
CSADDR_INFO  m_CSABuf[20];            // Socket address information
DWORD  m_dwCSABufsize;    // Size of Socket address buffer structure
int    m_iWorkProts[30]; // Information of workable network protocol  
int    m_iNumWorkProts;  // Number of workable network protocol
LPPROTOCOL_INFO  m_lpProtBuf;  // Buffer for protocol information
VTMSG  m_vtRecvMsgBuf;          // Message structure for sending out  
VTMSG  m_vtSendMsgBuf;          // Message structure for receiving
BOOL   m_bConnect;              // Flag to check connection 
BOOL   m_bTalking;              // Flag to check communcation
BOOL	 m_bVoiceMsg;    // Flag to check message type, text or voice
VTPlayWave m_vtPlay;  // Device to play receiving voice message
VTRecordWave m_vtRecord;//Device to record voice message to send out
char m_pWaveData[VT_MAX]; // Buffer to store receiving voice message
unsigned int m_uiBufLen; // Buffer length of voice message
int m_iWaveFormat;// Wave I/O device type, see definition in vtDef.h
Cstring  m_strUserName;           // The user name
CString  m_strServer;             // The server name
BOOL m_bVoiceTalk;    // Flag to check in voice talk or not
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TALKCLIENTDLG_H__8068D458_3CAB_11D4_8ECB_00805FBDCBE4__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -