Board index » cppbuilder » Re: Passing info between threads
Paul at NCF
Re: Passing info between threads
2007-02-22 04:34:49 PM
I think you're nearly there but just a few things:
make the threadlist a member of the thread, not the form, add a
Then I have:
AddCommand(SctpCmdParams) method to the thread which does
SctpCommandList->Add(SctpCmdParams), or go one step further and make the
parameters of that method the fields you need to pass to the thread that
need adding to 'its' queue. That way you can change the entire queueing
system in the thread and the main form would not know or be affected.
command to the list in the MainForms scope, and also does the operation of
processing the queue in the main forms scope. The HandleCommand needs to be
done via the threads execute method to make the thread do the work, the main
form needs to add and then signal the thread. If you want to get the
principle of the queue processing working initially you can just get the
thread execute to Sleep(10ms) and then check if the queue is non-empty in
its while loop.
Hope this helps.