Click here to Skip to main content
15,886,067 members
Articles / Desktop Programming / MFC

VoIP For You - Full duplex 8bit/8KHz VoIP application for Windows98 & DirectX

Rate me:
Please Sign up or sign in to vote.
3.63/5 (41 votes)
31 Aug 20035 min read 299.4K   11.6K   88  
Sending and receiving voice under TCP/IP and Windows 98 & Direct X.
// SockDlg.h : header file
//

#if !defined(AFX_SOCKDLG_H__D605748A_E1E6_11D1_ADD3_00A02429D966__INCLUDED_)
#define AFX_SOCKDLG_H__D605748A_E1E6_11D1_ADD3_00A02429D966__INCLUDED_

#include "MySocket.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CSockDlg dialog

class CSockDlg : public CDialog
{
// Construction
public:
	//This buffer will contain 500 samples of audio data
	//data is in 8KHz, 8bit PCM audio format
	byte audio[500];

	int c;
	int count;
	CString m_Status;
	void OnSend();
	void OnReceive();
	void OnClose();
	void OnConnect();
	void OnAccept();
	CSockDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CSockDlg)
	enum { IDD = IDD_SOCK_DIALOG };
	CListBox	m_ctlSent;
	CListBox	m_ctlRecvd;
	CButton	m_ctlConnect;
	CString	m_sMessage;
	CString	m_sName;
	int		m_iType;
	int		m_iPort;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSockDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CSockDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnRType();
	afx_msg void OnBconnect();
	afx_msg void OnBsend();
	afx_msg void OnBclose();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	BOOL m_bConnected;
	CMySocket m_sListenSocket;
	CMySocket m_sConnectSocket;
	int lenght;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SOCKDLG_H__D605748A_E1E6_11D1_ADD3_00A02429D966__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Systems Engineer
Bulgaria Bulgaria
PhD, Cum Laude in digital automation systems
M.S. in Telemommunication management
B.S. in Telecommunication systems engineering
Programming: CUDA, C/C++, VHDL
Software and Hardware development and consulting:
data acquisition, image processing, medical instrumentation

Comments and Discussions