memset(buffer,0,sizeof(buffer));
memset(temp,0,sizeof(temp));
int rcv = recv(s,buffer, 1024, 0);
for (int i=0; buffer[i]!='*'; i++)
{
temp[i] = buffer[i];
}
temp[i++] = '\0';
CString strFileName = temp; //得到文件名
strcpy(temp, buffer + i);
long lFileSize = atol(temp); //文件大小;
m_progress.SetRange32(0, lFileSize); //设置进度条范围
m_progress.SetStep(1); //设置进度条步长
论文网http://www.751com.cn/
m_progress.ShowWindow(SW_SHOW);
m_cState.SetWindowText("教师屏幕正在接收....");
if(pBuffer!=NULL)
{
delete[] pBuffer;
pBuffer=NULL;
}
pBuffer=new char[lFileSize+1];
pBuffer[0]='\0';
char* pBuf=pBuffer;
long iTemp = 0;
while (1)
{
//循环接收教师屏幕文件
rcv = recv(s, buffer, 1024, 0);
if (rcv <= 0)
{
break;
}
for (int i=0; i<=rcv; i++)
{
pBuf[i+iTemp] = buffer[i];
}本文来自辣.文~论^文·网原文请找腾讯32491.14
iTemp+=rcv;
m_progress.SetPos(iTemp);
}
if (iTemp!= lFileSize)
{
//接收教师屏幕失败
AfxMessageBox("教师屏幕接收失败!");
return ;
}
ShowPIC( pBuf, lFileSize);
m_iSize =lFileSize;
<< 上一页 [21] [22]
C++的多媒体屏幕广播教学系统设计 第22页下载如图片无法显示或论文不完整,请联系qq752018766