C/C++ >> CWintread Question
Posted by tcm1998 on 16:53:00 07-13-2001
Does anyone know if it's possible to add some parameters to the constructor of an object derived from CWinThread ?

Let me explain what I mean:

CThread : public CWinThread

Now I can start it with:

myThread * CThread= AfxBeginThread (RUNTIME_CLASS(CThread),some priority);

Now the constructor of this thread is called implicitely.

Ok, now I have add another constructor to my class and want to start that one.

CThread::CThread (int test);

How can I input this parameter in the AfxBeginThread call ?










Posted by robost86 on 20:29:00 07-13-2001
I know how to use Windows threads with plain Win API, but not with that class library you're using.
Posted by KaGez on 17:40:00 07-23-2001
I also dunno it ... sorry
[addsig]
Posted by icemojo on 06:55:00 08-05-2001
not sure if something like this works...

CThread *myThread = AfxBeginThread((AFX_THREADPROC)CThread::SomeProc, param, priority);

and you'd have something like
int CThread::SomeProc(LPVOID pParam)
{
int *test = (int *)pParam;
...
}
Posted by icemojo on 06:56:00 08-05-2001
not sure if something like this works...

CThread *myThread = AfxBeginThread((AFX_THREADPROC)CThread::SomeProc, param, priority);

and you'd have something like
int CThread::SomeProc(LPVOID pParam)
{
int *test = (int *)pParam;
...
}
Posted by KaGez on 15:52:00 08-24-2001
maybe you can overwrite the function of Wintread since it's a class ?
[addsig]