المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : CAsynSocket CWinthread Question



C++ Programming
08-06-2009, 08:40 PM
Hi,

I woud Like to Use the CAsynSocket CLass as Member of CWinThread

In My Main Cwinthread I would like to Have 4 pointers to My CWinThreadSAsynSocket CLass'es


My question is the Following On Initinstance of the main thread

I would like to inistantiate them with the "new" operators and save thier m_thread id's

I Know that since CAsynSocket notfies completion via messages these Thread will have to be

of the UI variety

So. my question is When I want to pass them (threads a socket) to do work

I would ::Create the connection/socket

then Detach my socket and have them Attach the Socket

How do Notify them

Can I leave them in a Suspended status and do a Resume when I want them to take off

or since they are UI threads with a message pump they constantly have to be looping

and then my way of notifying them would be with PostThreadMessage ????

thankx