thnx for your valuable suggestion.
This is what i did:
Code:
char *thread_buffer;
thread_buffer = new char[];
thread_buffer = (*(start_thread_parm*)thread_parm).comd; // dynamically allocating the variable as suggested
SetEvent((*(start_thread_parm*)thread_parm).continue_broadcast_handle); // tells the parent thread that i have finished copying the parmeter to the child thread and it's ok to continue to return
This is the class of "start_thread_parm" summarized
Code:
class start_thread_parm{
public:
{
char *comd;
HANDLE continue_broadcast_handle;
}
is this the way to do it?
i keep getting the same problem when the parent thread returns, ie. the variable goes out of scope when the parent thread returns.
thread_buffer becomes empty after the line "SetEvent((*(start_thread_parm*)thread_parm).conti nue_broadcast_handle); "
I am doing something wrong here. any help plz?