G
Gregory Goeppel
I have a component (with NO user interface) in C# that
fires events from a seperate thread. The client of the C#
component does processing with UI elements and other non
thread safe variables within these events. I do NOT want
the client to be processing the event from the secondary
thread created in the component. I want it to process from
the Main UI thread.
I have scanned through MSND documentation and it keeps
saying to use control.BeginInvoke() in the client to do
this. However requiring the client of my component to do
this is one more thing that can go wrong for users of my
component. So I want it performed from within the
component. In C++ I could acheive this by using PostMessage
() specifying an HWND in the main thread.
How do I do this in C# from within the component that is
invisible at runtime. My component object does not have a
BeginInvoke on it. Should I create a hidden control from
within the component simply to marshall back to main
thread from within itself?
Any Ideas would be appreciated. TIA
-Greg.
fires events from a seperate thread. The client of the C#
component does processing with UI elements and other non
thread safe variables within these events. I do NOT want
the client to be processing the event from the secondary
thread created in the component. I want it to process from
the Main UI thread.
I have scanned through MSND documentation and it keeps
saying to use control.BeginInvoke() in the client to do
this. However requiring the client of my component to do
this is one more thing that can go wrong for users of my
component. So I want it performed from within the
component. In C++ I could acheive this by using PostMessage
() specifying an HWND in the main thread.
How do I do this in C# from within the component that is
invisible at runtime. My component object does not have a
BeginInvoke on it. Should I create a hidden control from
within the component simply to marshall back to main
thread from within itself?
Any Ideas would be appreciated. TIA
-Greg.