Re: HELP: AfxBeginThread problem
- From: David Lowndes <davidl@xxxxxxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 11:26:45 +0100
>Previously, this has been how i've been beginning a new thread:
>AfxBeginThread(SomeFunction, this); //being called from my applications Doc
>class
>SomeFunction was a global function:
>UINT SomeFunction(LPVOID pParam);
>
>However, I want to add an extra parameter to SomeFunction:
>
>UINT SomeFunction(LPVOID pParam, DataClass * pData);
>
>So now when I go to start a thread with this function, how to I do it?
Not like that obviously ;)
Pass the pointer to a structure (or class) that contains all the data
you need via the single void pointer parameter and cast appropriately
back to a pointer of your structure inside your thread function.
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
.
- References:
- HELP: AfxBeginThread problem
- From: Hamish
- HELP: AfxBeginThread problem
- Prev by Date: HELP: AfxBeginThread problem
- Next by Date: How to execute MFC C++ apps
- Previous by thread: HELP: AfxBeginThread problem
- Next by thread: Re: HELP: AfxBeginThread problem
- Index(es):
Relevant Pages
|