Re: HELP: AfxBeginThread problem
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 11:26:32 -0400
You can pass one pointer. There is no reason to assume it is even possible to pass two
pointers. But if you can pass one pointer, you can pass anything you want, including a
pointer to a struct that contains two pointers. Just remember you must allocate this
object on the heap, not the stack.
joe
On Wed, 14 Sep 2005 21:18:43 +1200, "Hamish" <h.dean@xxxxxxxxxx> wrote:
>Hi.
>
>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?
>
>AfxBeginThread(SomeFunction, this);
>i'm not passing in the pData, and the compiler says: error C2665:
>'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type
>'unsigned int (__cdecl *)(void *,class DataClass *)'
>
>AfxBeginThread(SomeFunction(this, pData), this);
>also does not work: error C2665: 'AfxBeginThread' : none of the 2 overloads
>can convert parameter 1 from type 'unsigned int'
>
>Ideas?
>
>
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- HELP: AfxBeginThread problem
- From: Hamish
- HELP: AfxBeginThread problem
- Prev by Date: Re: Why MFC doesn't like /vmg?
- Next by Date: Re: Who to Rototate an Ellipse in client area to specified angle
- Previous by thread: Re: HELP: AfxBeginThread problem
- Next by thread: Re: AfxBeginThread problem
- Index(es):
Relevant Pages
|
Loading