I have a running strategy with NT7 and now, I do the jump to NT8. My problem is, that my threadning to an external source doesn´t work in NT8. I need some help with the dispatcher:
Under State.Configure I can establish a confirmed connection:
if (State == State.Configure) { Configuration config = new Configuration(); config.Symbol = "Test"; Connect("xxx.x.x.x", xxxx, config); }
Under NT7 everything works fine. Also under NT8 I can establish a connection. With NT8 I learned, that I have to use a dispatcher and the ApartmentState.STA:
protected override void OnBarUpdate() { Owner.Dispatcher.BeginInvoke(new Action(() => { DefineSendData1(); DefineSendData2(); })); }
patternThread.SetApartmentState(ApartmentState.STA);
"Error on calling the OnBarUpdate()... The calling thread must be STA disappears."
But now I get the warning:
"Error on calling the OnBarUpdate()... Object reference not set to an instance of an object."
I have two questions:
- Is there any major change in Threadning, that I have to write the Threadning part completly new? Or
- do I have to do only minor changes to get my old code running in NT8?
I would be happy for some help.
Thanks
uupsa!
Comment