Click here to Skip to main content
15,888,521 members
Articles / Desktop Programming / MFC

A Simple Prototype for Demonstration of Voice Communication via Network/Internet

Rate me:
Please Sign up or sign in to vote.
4.35/5 (24 votes)
14 Jun 2000 204K   8.4K   102  
Voice communication
/**************************************************************************
 *    file:         talkserverDlg.h                                       *
 *    create:       June 9, 2000                                          *
 *    copyright:    @ 2000, by Zhaohui Xing                               *
 *    e-mail:       xinghh@yahoo.com                                      * 
 *    description:  definition of CTalkserverDlg class                    *
 **************************************************************************/
#if !defined(AFX_TALKSERVERDLG_H__A051048C_5FA9_45D9_81CE_D9ED862E1D59__INCLUDED_)
#define AFX_TALKSERVERDLG_H__A051048C_5FA9_45D9_81CE_D9ED862E1D59__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "vtDef.h"

/////////////////////////////////////////////////////////////////////////////
// CTalkserverDlg dialog

class CTalkserverDlg : public CDialog
{
// Construction
public:
	CTalkserverDlg(CWnd* pParent = NULL);	// standard constructor
    ~CTalkserverDlg();

// Dialog Data
	//{{AFX_DATA(CTalkserverDlg)
	enum { IDD = IDD_TALKSERVER_DIALOG };
	CListBox	m_ClientList;              // List of available client
	CListBox	m_ProtList;                // List of compatible protocol
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CTalkserverDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnTimer(UINT nIDEvent);
 	afx_msg LONG OnVTConnected(WPARAM wparam, LPARAM lparam);
 	afx_msg LONG OnVTDataReady(WPARAM wparam, LPARAM lparam);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	LPVTMSG       m_vtMsgBuf;           // Buffer of communication message
	VTSAPPACK     m_vtSAPData;          // SAP packet data
    LPVTSOCKET    m_lpServSocks;        // Server sockets to listen
    LPVTSOCKET    m_lpClientSocks;      // The sockets to connect 
	                                    // with the clients

    HANDLE             m_hConnectHeap;  // Handle of the heap for client sockets
    LPPROTOCOL_INFO    m_lpProtBuf;     // Buffer for protocol information
    SOCKET             m_SAPSocket;     // SAP socket
    SOCKADDR_IPX       m_SAPSockAddr;   // SAP socket address
	SOCKADDR_IPX       m_SAPDestSockAddr;   // SAP destination socket address 
    
	int    m_iNextFree;                 // Available buffers for client sockets
	int    m_iMaxConnects;              // The maxnium connection of clients
	int    m_iWorkProt;                 // The compatible protocol numbers

protected:
    BOOL   InitServSocks(void); 
    BOOL   InitClientSocks(void);
	void   DeRegisterClient(char* sClientName);
	void   UpdateProtList(int index);
	void   UpdateClientList(char* name, int status, char* peername);
};

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

#endif // !defined(AFX_TALKSERVERDLG_H__A051048C_5FA9_45D9_81CE_D9ED862E1D59__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.


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions