![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Chris, Why not list the reasons why this issue is "not relevant" to the compact framework. For me it is indeed relevant because I'm trying to find the best solution for both the compact and the desktop framework. Maybe those "several reasons" contains some good information. Share your knowledge instead of being slightly... ;-) /John "Chris Tacke, eMVP" <ctacke (AT) spamfree-opennetcf (DOT) org> wrote Quit posting to multiple groups. This is completely not relevant to the Compact Framework for several reasons. -- Chris Tacke, eMVP Advisory Board Member www.OpenNETCF.org "Johan" <franson (AT) hotmail (DOT) com> wrote in message news:446a1750.0306300947.7c102862 (AT) posting (DOT) google.com... Hi! I am writing a library in managed C++ for the .NET framework. I have problems fireing events from a worker thread. The managed event must be raised from the main thread, but I cannot find any way to pass control from the worker thread to the main thread. In the COM programming model the problem was solved by creating an invisible window which the worker thread passed win32 messages to. With what is that paradigm replaced in .NET? I have found some solutions that involves the Control.Invoke method. This approach works if you got access to the clients Form handle, but since I am writing a library (and not a control) I don't now how to get that. Instead I get this error message if a I let my class inherit from Control and then call Invoke() "An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll Additional information: Cannot call Invoke or InvokeAsync on a control until the window handle has been created." Do anyone have the solution of how to raise events from a .NET library's worker thread? I would be more than pleased if I anyone gave me some key information! Regards, John |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |