End Google Ads 201810 - BS.net 01 --> It can be send data to remote server from CString ?
Here is "original code" :
bool CSmtp::SendData()
{
int idx = 0,res,nLeft = strlen(SendBuf);

assert(SendBuf);

if(RecvBuf == NULL)
return false;

while(nLeft > 0)
{
if( res = send(hSocket,&SendBuf[idx],nLeft,0) == SOCKET_ERROR)
{
m_oError = CSMTP_WSA_SEND;
return false;
}
if(!res)
break;
nLeft -= res;
idx += res;
}
return true;
}
which I want to convert into :
BOOL CSmtp::SendData()
{
if(send(m_hSocket,m_sSendBuf,1024,0) == == SOCKET_ERROR)
{
m_nError = CSMTP_WSA_SEND;
return FALSE;
}

return TRUE;
}

m_sSendBuf is CString data member