⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dmsdlg.cpp

📁 中国移动高阳平台SP语音网关。绝对可用! 目前(现在是20080613)我们公司使用的这个!
💻 CPP
📖 第 1 页 / 共 2 页
字号:
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10003:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM NEWMQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10004:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM NEWMQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10005:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM NEWMQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10006:
			try
			{
				NextSongId=atoi(bStr[0]);
				sprintf(strNextSongId,"%d",NextSongId);
				command="SELECT mobile FROM olduser where mobile= '";
				command+=bStr[0];
				command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");
				if(nCount2!=0)
				{
					sprintf(g_Data.pack_body,"1");
				//插入数据库播打记录
				//*******
				insertcommand="insert into BDUSER(mobile,datetime,callmobile) values('";
				insertcommand+=bStr[0];
				insertcommand+="',getdate(),'125905860')";				
				m_pConnection->Execute((LPCTSTR)insertcommand,&Affected,adCmdUnknown);	
				//*********			
				}
				else
				{
					sprintf(g_Data.pack_body,"2");
				//插入数据库播打记录
				//插入数据库播打记录
				//*******
				insertcommand="insert into BDUSER(mobile,datetime,callmobile) values('";
				insertcommand+=bStr[0];
				insertcommand+="',getdate(),'125905860')";				
				m_pConnection->Execute((LPCTSTR)insertcommand,&Affected,adCmdUnknown);	
				//*********	
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10007:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM MQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10008:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM MQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10009:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM MQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10010:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM MQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;
case 10011:
			try
			{
				NextSongId=atoi(bStr[3])+1;
				sprintf(strNextSongId,"%d",NextSongId);
					command="SELECT * FROM MQJ where type1= '";
					command+=bStr[1];
					command+="' and type2= '";
					command+=bStr[2];
					command+="' and type3= '";
					command+=strNextSongId;
					command+="'";
				query = command;
				m_pRecordset.CreateInstance("ADODB.Recordset"); 
				m_pRecordset->Open(query,_variant_t((IDispatch*)m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText); 
				nCount2=m_pRecordset->GetRecordCount();
				sprintf(g_Data.pack_body,"");
				strcpy(bufsend, "");

				if(nCount2!=0)
				{
					strcpy(bufsend, strNextSongId); //歌曲id
					strcat(bufsend,"|");
					//strcat(bufsend,bStr[1]); //歌曲的名称
					strSongName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("name");//歌曲的名称
					strcat(bufsend,strSongName); //歌曲的名称
					sprintf(g_Data.pack_body,bufsend);
				}
				else
				{
					sprintf(g_Data.pack_body,"0");
				}
				}
				catch(_com_error e)
				{			 
				}
				break;

	default:
			break;
	};
	m_pRecordset->Close();
	m_pRecordset.Release();
	m_pConnection->Close();
	m_pConnection.Release();

	SendMsgFunc * fsend = (SendMsgFunc*)GetProcAddress(hModule, "VSPPSendMessage");
	if(NULL == fsend)
	{		
		::AfxMessageBox("Call VSPPSendMessage() failed");
		return;
	}
	int iret = fsend( (unsigned char*)g_Data.IP, g_Data.port,g_Data.pack_head, g_Data.pack_body );
	send++;
	if(iret == 0)
	{
		str.Format("%d",send);
		strcat(buf, g_Data.pack_body);
		pDlg->GetDlgItem(IDC_SEND)->SetWindowText(str);
		pDlg->GetDlgItem(IDC_EDIT_SENDP)->SetWindowText(buf);
	}
	memset(buf, '_', MAX_PACKET_LEN);      // release..
	buf[MAX_PACKET_LEN] = 0;
	delete[] buf;  buf = 0; 

   //LeaveCriticalSection(&dataCS);
}

void CDMSDlg::OnCancel() 
{
		try
	{
	// TODO: Add extra cleanup here
/*	//释放与数据源的连接
	if(m_pConnection->State == adStateOpen) 
		m_pConnection ->Close();
	m_pConnection.Release();
	if(m_pRecordset->State == adStateOpen)
		m_pRecordset->Close();
	m_pRecordset.Release();
*/
	//释放线程句柄

	end = true;
	DWORD exitcode;
	
		GetExitCodeThread(recvThread, &exitcode);
		TerminateThread(recvThread,exitcode);
		CloseHandle((void*)recvThread);
		if(hModule)	 FreeLibrary(hModule);
		CDialog::OnCancel(); 
	}
	catch(_com_error e)
	{
     ::AfxMessageBox("End");
	 CDialog::OnCancel();
	}
		CDialog::OnCancel(); 
}



void CDMSDlg::OnButton2() 
{  
	
	
}



void CDMSDlg::OnButton4() 
{
  
	
}

void CDMSDlg::OnButton1() 
{
		
			
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -