You should create a global structure. Pass a reference or pointer of the structure to the worker thread.

For example:

-----
// this should be global

UINT YourWorkerThreadFunc(LPVOID pParam);

typedef struct tagYOURWORKERTHREAD
{
... // whatever you want to pass into the worker thread
...
...
} YOURWORKERTHREAD;
----

----
YOURWORKERTHREAD *ptp = new YOURWORKERTHREAD;

ptp->blah = whatever
...

CWinThread *m_pYourWorkerThread = AfxBeginThread(YourWorkerThreadFunc, ptp, THREAD_PRIORITY_NORMAL,
0, CREATE_SUSPENDED);

m_pYourWorkerThread ->m_bAutoDelete = FALSE;

// You need this to close the worker thread later

m_pYourWorkerThread = m_pYourWorkerThread ->m_hThread;
m_pYourWorkerThread ->ResumeThread();
-----


Kuphryn