Click to See Complete Forum and Search --> : RUNTIME_CLASS thread


lsvedin
December 16th, 2004, 01:55 PM
In most of the thread examples I have seen, they are kicking off a thread by using a function and passing it a pointer to a struct contained with data needed for communciations

I am kicking off a thread by using the RUNTIME_CLASS of an object derived from CWinThread. I don't see a way of passing it any info such as handles to windows, etc. Is there any way around that?

MrViggy
December 16th, 2004, 03:59 PM
I think I did this once. If I remember correctly, the CWinThread * that is passed back from the call to AfxBeginThread is actually a pointer to your class.

So, you create the thread suspended; cast the return pointer to your RUNTIME_CLASS; set-up all the data; then resume the thread.

I think...

Viggy

MrViggy
December 16th, 2004, 04:00 PM
I mean, cast the return pointer to a pointer to your class, not the actual RUNTIME_CLASS macro.

Sorry!

Vig.

lsvedin
December 16th, 2004, 05:37 PM
Will try. Thanks