Re: multithreaded application using MFC
Make 2 variables of your CMyData class in your CMySocket lets suppose.
CMyData m_pSDataThread; //pointer of send data thread
CMyData m_pRDataThread; //pointer of receive data thread
when u create socket then create both threads
m_pSDataThread=(CMyData *)AfxBeginThread(RUNTIME_CLASS(CMyData));
m_pRDataThread=(CMyData *)AfxBeginThread(RUNTIME_CLASS(CMyData));
now your have 2 threads one for receiving data and one for sending data.
at this point you should have your socket class pointer in both of threads for accessing socket .
make a variable in your CMyData class
CASyncSocket *m_pMySocket;
and after creating your threads assign your socket class pointer in m_pMySocket pointer.
// assigning socket class pointer in thread class
m_pSDataThread->m_pMySocket=this;
m_pRDataThread->m_pMySocket=this;
hope this will help u
A Person who is polite is given goodness and a person who is away from Politeness is away from Goodness.
NAUMAAN