Heya, I'm implementing some threaded actions in my (not yet released) plugin for HB, and wonder what would be right way to invoke into GUI thread, or the thread where is safe to run LUA, access WoWItem objects database etc. First idea was to use: "Honorbuddy.App.Current.MainWindow.Dispatcher" for invoking, but access to this one is not possible at the time plugin "pulsing". So, if anyone do the threadings in their plugins - by what object and what time you get threads synchronized to the place where it's safe to do stuff? Thank you, Me. ps. if I do stuff in my thread without invoking - I get following exceptions: [21:27:37:187] PULSE: Cannot read a descriptor on an invalid object. at Styx.WoWInternals.WoWObjects.WoWObject.GetStorageField[T](UInt32 field) at Styx.WoWInternals.WoWObjects.WoWObject.GetStorageFieldByOffsetIndex[T](Int32 offsetIndex) at Styx.WoWInternals.WoWObjects.WoWUnit.GetCurrentPower(WoWPowerType type) at Styx.WoWInternals.WoWObjects.WoWUnit.GetPowerInfo(WoWPowerType type) at Styx.WoWInternals.WoWObjects.WoWUnit.get_HealthPercent()
Meanwhile, found the (seem to be) working answer by myself: // setup dispatcher MainDispatcher = Dispatcher.CurrentDispatcher; .. MainDispatcher.BeginInvoke(PulseThreadDelegate, ...); .. Will test it further, but for some time works fine.