Home > Software engineering >  Communication IP
Communication IP

Time:10-04

 if (m_pCSocSend=new CSocSend (this)) 
{
If (m_pCSocSend - & gt; Create ())//Create a socket
{
If (m_pCSocSend - & gt; Connect (I, 1000))//the server name, port number
{
M_pCSocSend - & gt; M_pCSocFile=new CSocketFile (m_pCSocSend);
M_pCSocSend - & gt; M_pCArcIn=new CArchive (m_pCSocSend - & gt; M_pCSocFile CArchive: : load);
M_pCSocSend - & gt; M_pCArcOut=new CArchive (m_pCSocSend - & gt; M_pCSocFile CArchive: : store);
M_lst_log. AddString (" connection is successful, can start message!" );
M_btn_send. EnableWindow (TRUE);
}
The else
{
M_lst_log. AddString (" connection is not successful!" );
The delete m_pCSocSend;//remove the socket of memory
}



The first button:
 void CSocCltDlg: : OnButton1 () 
{
//TODO: Add your the control notification handler code here

GetDlgItem (IDC_EDIT1) - & gt; GetWindowText (I);
MessageBox (I);
}
could you please tell me, why don't have to enter the IP address in the first edit box can connect a success?

CodePudding user response:

May write dead,

CodePudding user response:

reference 1st floor shiyanzi response:
may write dead,

what does that mean?

CodePudding user response:

You have a look at m_pCSocSend - & gt; Connect (I, 1000) function is how to achieve?

CodePudding user response:

What is your I information, you can see if you connect connected to where go to

CodePudding user response:

VS IDE, I don't understand the symbol on the right mouse button, choose to define or check all references,

CodePudding user response:

Did you do after you delete a pointer to null, become a wild pointer used to do

CodePudding user response:

The
reference 3 floor VisualEleven response:
you see m_pCSocSend - & gt; Connect (I, 1000) function is how to achieve?

Ha ha ~ good like this picture
  • Related