void DSocket::OnReceive(int errcode)
{CString address;
char strtwo[2000];
sprintf(strtwo,"addressreceive %s ",address);
AfxMessageBox(strtwo);
char hname[400],str[1000],mesg[500];
unsigned int port,retvalue;
int n,len;
RequestDlg rdlg(NULL); // Note : if no error has occured then RETVALUE contains
//   the COUNT of actual bytes received.
// Control type 
if(type==TYPE_CONTROL)
{sprintf(strtwo,"addressreceive %s ",address);
AfxMessageBox(strtwo);
retvalue=this->ReceiveFrom(data,length,address,port);
char strone[2000];
sprintf(strone,"addressReceiveFrom %s ",address);
AfxMessageBox(strone);
if(retvalue==SOCKET_ERROR)
return;
// Get host name from the data.
for(int i=0;i<data[1];i++)
hname[i]=data[i+2];
hname[i]=0;
strcpy(remotename,hname);
strcpy(remoteaddress,(LPCTSTR)address);
switch(data[0])
{ // action   : Remote user has sent the invitation for conference
// reaction : accept/reject the invitation
case MESG_CONNECT:
// display the accept , reject dialog box
rdlg.SetParameter(remotename,remoteaddress,pdlg);
rdlg.DoModal();
return;
// action   : Remote user has disconnected
// reaction : destroy the conference
case MESG_DISCONNECT:
( (CVideoNetDlg*)pdlg)->DestroyConference();
sprintf(str,"User %s has disconnected",hname);
AfxMessageBox(str);
return;
// action   : Remote user has accepted the invitation
// reaction : start the conference
case MESG_ACCEPT:
AfxMessageBox("User has accepted the connection");
( (CVideoNetDlg*)pdlg)->StartConference();
return;
// action   : Remote user has rejected the invitation
// reaction : what to do...?
case MESG_REJECT:
sprintf(str,"User %s has rejected your invitation",hname);
AfxMessageBox(str);
return;

}
return;

}
我现在最郁闷的是,弹出对话框在第一个里的文字是“addressreceive”没有后面的IP,而第二个却有,我现在想问address地址值从哪里来