Hi Cliff,
Have you got a sample of the code that throws the error? Usually in .NET you would use the Invoke method to execute some code using the thread that owns a control’s specific window handle. I’ve often used this in the past to update a GUI (e.g. a progress or status bar) on the main application thread from a worker thread that is executing some long running process.
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.invoke(v=vs.110).aspx
Tom
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Cliff,
Because you’re using a background worker thread and the form’s window handle is held by the main UI thread you’ll need to use the form to invoke the action within your delegate. This should work I believe:
delegate (object Sender, DoWorkEventArgs WorkEventArgs)
{
if(InvokeRequired)
this.Invoke(new Action(() => OpenTable()));
else
OpenTable();
};
Best regards,