![]() |
| | #1 |
| Registered User Join Date: Apr 2007
Posts: 4
| Help for Socket Programming C++ The code as follows: Code: void CSampleClientDlg::OnButtonSend()
{
SOCKET TempSoc;
TempSoc = (SOCKET)m_hComm;
TCHAR szBuf[255]={0};
m_bDataToSend = TRUE;
CString strText = "";
m_Send.GetWindowText(strText);
_tcscpy(szBuf,strText);
int nRet = send(TempSoc,szBuf,strText.GetLength(),0);
if(nRet == SOCKET_ERROR)
AfxMessageBox("Error in Sending");
}
|
| cplusplus.Jr is offline | |
| | #2 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 229
| Using easy words, the winsock work on that piece of code can be understand as: Code: SOCKET TempSoc; TempSoc = (SOCKET)m_hComm; Code: int nRet = send(TempSoc,szBuf,strText.GetLength(),0); Hope that will help; also you can take a look to the 'Useful links and books' thread on that networking board. Niara Last edited by Niara; 04-02-2007 at 04:48 AM. |
| Niara is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|