Click here to Skip to main content
15,895,783 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 302.7K   11.6K   88  
Sending and receiving voice under TCP/IP and Windows 98 & Direct X.
// MySocket.cpp : implementation file
//

#include "stdafx.h"
#include "Sock.h"
#include "MySocket.h"
#include "SockDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMySocket

CMySocket::CMySocket()
{
}

CMySocket::~CMySocket()
{
}


// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CMySocket, CAsyncSocket)
	//{{AFX_MSG_MAP(CMySocket)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif	// 0

/////////////////////////////////////////////////////////////////////////////
// CMySocket member functions

void CMySocket::SetParent(CDialog *pWnd)
{
	// Set the member pointer
	m_pWnd = pWnd;
}

void CMySocket::OnAccept(int nErrorCode)
{
	// Were there any errors?
	if (nErrorCode == 0)
		// No, call the dialog's OnAccept function
		((CSockDlg*)m_pWnd)->OnAccept();
}

void CMySocket::OnConnect(int nErrorCode)
{
	// Were there any errors?
	if (nErrorCode == 0)
		// No, call the dialog's OnConnect function
		((CSockDlg*)m_pWnd)->OnConnect();
}

void CMySocket::OnReceive(int nErrorCode)
{
	// Were there any errors?
	if (nErrorCode == 0)
		// No, call the dialog's OnReceive function
		((CSockDlg*)m_pWnd)->OnReceive();
}

void CMySocket::OnClose(int nErrorCode)
{
	// Were there any errors?
	if (nErrorCode == 0)
		// No, call the dialog's OnClose function
		((CSockDlg*)m_pWnd)->OnClose();
}

void CMySocket::OnSend(int nErrorCode)
{
	// Were there any errors?
	if (nErrorCode == 0)
		// No, call the dialog's OnSend function
		((CSockDlg*)m_pWnd)->OnSend();
}

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