By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

Problem calling Invoke to call a delegate on a child thread

P: n/a
Morning all. Let me describe my problem.

Main thread creates child objects and threads and starts them
Timer on the main thread (which only gets activated after the child threads
have started) periodically calls a function Refresh().
This refresh function runs on its own thread and queries our database for
new jobs.
For each job found this timer invokes a delegate on one of the child thread
objects.
I then get the error "Cannot call Invoke or InvokeAsync on a control until
the window handle has been created" on the line invoking the delegate

I can breakpoint the "invoke" call and inspect the object being called and
all looks good so i'm kinda at a loss
FYI this is my invoke call
this.Invoke( myParent.Queuer[i].ReceiveJobs, new object[] {
JobStore[index] } );

I have a breakpoint in the first line of the method set to receive
notification when this delegate is fired but it never gets control.

Can anyone suggest something, *anything* I should be looking at?

Thanks
PT
Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.