juse Posted February 13, 2017 #1 Share Posted February 13, 2017 Hello, I try to implement the following into a custom crm wpf (VB.NET) application: seach for a person with the number that is just calling and show his person. With the samples I managed to create a method that reacts on the fired event of the clientlinemgr. But the SDK Interop.CLMBGLib.DLL unfortunately seems to create a new Thread and no matter what I do, I'm in the wrong Thread now and I get errors. That is a problem, because I need to call functions that show user controls in a window etc. and in WPF I need to do that on the Application STA Thread. There is only this one thread allowed in WPF to operate with UI components. Is there any chance to acomplish my task, anyway? I added my sample to this post. Thanks in advance for any help! mysample.vb Link to comment Share on other sites More sharing options...
juse Posted February 17, 2017 Author #2 Share Posted February 17, 2017 No solution possible for this problem? Link to comment Share on other sites More sharing options...
Pascal Barth1 Posted February 22, 2017 #3 Share Posted February 22, 2017 Hey Juse, I had a problem like yours. Can you solve it by invoking the WPF class? I just know it by Windows Forms... Example for my Invoking from an other thread: this.Invoke(new Action(() => { label8.Text = myNetPhoneClient.UserName; SetUserStateOn(); })); Link to comment Share on other sites More sharing options...
juse Posted March 2, 2017 Author #4 Share Posted March 2, 2017 Thank you for your input! I tried using Dispatcher.Invoke (via DispatcherHelper from MVVM Light) and after I intialized the DispatcherHelper correctly, it finally does what I wanted! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.