Click to See Complete Forum and Search --> : my stupid ... ???


Nostradamus
December 17th, 2004, 05:19 AM
i try to write a chat program. (server and client)
I use MFC VC6++
For Server :
I create a class CListenSocket , CClientSocket.
Here is my CMyProgramDoc :
...................................
BOOL CChatserverDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;

m_pLSocket = new CListenSocket(this);
if (m_pLSocket->Create(1500))
{
if (m_pLSocket->Listen())
return TRUE;
}
return TRUE;
}


void CChatserverDoc::OnAccept()
{
m_pCSocket=new CClientSocket(this); ---> error Access Violation
m_pLSocket->Accept(*m_pCSocket); ---> error Access Violation
}
....................................

of course my socket call OnAccept
need some help