|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Event problem with VS 2005system when using the OneWay attribute. We get a null exception as outlined below in a ListDictionary with a count of zero. This is not our data structure, but appears to be the ThreadPool classes instance. Of course for OneWay, we do not want a WaitCallback, so I am suspect to see the call stack below. Can anyone help with this? IDid something change in VS 2005 with the OneWay attribute? We are using Visual Team Studio 2005 Professional. System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="mscorlib" StackTrace: at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMess age msg, IMessageSink replySink) at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Obje ct o) at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state) A little more on the situation: - The event creates (uses) a new thread from the thread pool and executes the delegate. The delegate may need to modify a control. If so, it marshals it over to the UI thread. The UI thread executes fine and processes the request. When it returns, the event delegate thread seems to crash. Changing to Serial or Async event handling works fine. I have enclosed the EventHelper class that we use. Only the OneWay causes problems. Switching it to Serial of Asynchronous works fine. I can provide the entire project for a simple test program. Roger [attached file: EventsHelper.cs] |
|||||||||||||||||||||||