Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MenuDlg.cpp
Package: RTP_video_audio.rar [view]
Upload User: sztlpcb
Upload Date: 2007-06-09
Package Size: 741k
Code Size: 4k
Category:
VOIP program
Development Platform:
Visual C++
- // MenuDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "multiplayer.h"
- #include "MenuDlg.h"
- /////////////////
- #include<iostream>
- #include<string>
- #include<fstream>
- #include<iomanip>
- #include <stdio.h>
- #include <conio.h>
- #include <windows.h>
- #define BUFSIZE 1024
- using namespace std;
- ////////////////////////
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMenuDlg dialog
- CMenuDlg::CMenuDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CMenuDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CMenuDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CMenuDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMenuDlg)
- DDX_Control(pDX, IDOK, m_load);
- DDX_Control(pDX, IDC_LIST1, m_list);
- DDX_Control(pDX, IDC_BUTTON2, m_register);
- DDX_Control(pDX, IDC_BUTTON1, m_play);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CMenuDlg, CDialog)
- //{{AFX_MSG_MAP(CMenuDlg)
- ON_BN_CLICKED(IDC_BUTTON1, OnPlay)
- ON_BN_CLICKED(IDC_BUTTON2, Onregister)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMenuDlg message handlers
- void CMenuDlg::OnPlay()
- {
- // TODO: Add your control notification handler code here
- CString buf;
- char itemname[50]="";
- char ch;
- int choose=-1;
- int recv_count=0;
- choose=m_list.GetCurSel();
- m_list.GetText(choose,buf);
- sprintf(itemname,"play %s",buf);
- //MessageBox(itemname,"play",MB_YESNO);
- switch(choose)
- {
- case 0:ch='A';break;
- case 1:ch='B';break;
- default:ch='X';break;
- }
- if(connect_sd!=NULL)
- send(connect_sd,&ch,1,0);
- else
- MessageBox("haven't register","error",MB_OK);
- recv_count=recv(connect_sd,sess_Addr,sizeof(sess_Addr),0);
- sess_Addr[recv_count]='';
- MessageBox(sess_Addr,"Session Address",MB_OK);
- }
- void CMenuDlg::Onregister()
- {
- // TODO: Add your control notification handler code here
- WSADATA wsadata;
- //SOCKET connect_sd;
- fd_set fdset;
- FILE *menufile;
- struct sockaddr_in src_addr; /* 跑计