I had try these:
CSocket* pSocket;
CString IPAdress;
UINT nPort;
.
.
.
pSocket = new CSocket();
pSocket->Create;
pSocket->GetSockName(IPAdress, nPort);
.
.
.
I can get nPort correctly, but IPAdress is "0.0.0.0". why? how can I get IPAdress correctly?

An other question is when I derived a class from CSocket to connect to FTP Server, I find OnReceive can't work, when I write two CSocket to connect each
other, it's worked good, why?
Thanks.