invoke

Dynamically invoke WCF Service from its URI (http://ip:port/Service1.svc?WSDL)

五迷三道 提交于 2019-12-21 05:38:21
问题 So here it is: I am trying to invoke a WCF Service's method from with in a windows form client application. I do not have the Contract Class Definition. The only thing I have is the Service's URI, which is http://ip:port/Service1.svc. So I thought i could make a proxy class for that. I want to make the proxy class at run time so any external tool to create a proxy class and import to project can't help me. I managed to make the proxy class on the fly. Here's the code: Dim mexClient As

How do I open a window on a new thread?

ぐ巨炮叔叔 提交于 2019-12-20 21:47:12
问题 I have a options window and a window that displays color based on these options and Kinect data. So far everything's on one thread (as far as I know; I haven't done any threading). Now, I'm adding an option to open a viewer window that will need to be updated with lowest possible latency. All this entails is creating a window and showing it: viewer = new SkeletalViewer.MainWindow(); viewer.Show(); When this event fires, the color window stops displaying colors (i.e. the event that fires 30

WPF Dispatcher.Invoke 'hanging'

血红的双手。 提交于 2019-12-20 17:23:04
问题 I have a somewhat complex WPF application which seems to be 'hanging' or getting stuck in a Wait call when trying to use the dispatcher to invoke a call on the UI thread. The general process is: Handle the click event on a button Create a new thread (STA) which: creates a new instance of the presenter and UI, then calls the method Disconnect Disconnect then sets a property on the UI called Name The setter for Name then uses the following code to set the property: if(this.Dispatcher.Thread !=

How to call a control method from another thread

左心房为你撑大大i 提交于 2019-12-20 07:36:21
问题 I want to call RichTextBox.Find() from another thread. How can I do that? The RichTextBox is located in a UserControl which I'm using in my form. I want to update it from another thread. I was able to change its properties using Invoke . But can't figure out how to call _ucResultRich.rchResult.Find(word, startIndex, RichTextBoxFinds.None); from my thread. Thread thread=new Thread(thrHighlight); thread.Start(e.RowIndex); private void ThrHighlight(object obj) { string[] words = ucSearchControls

When is invoke required on GUI objects?

巧了我就是萌 提交于 2019-12-20 02:48:11
问题 Using C# Windows.Forms, do the methods Invalidate(), Refresh(), etc. have to be run on the main/GUI thread (require Invoke/BeginInvoke)? How about changes to members of a GUI object such as adding/deleting Points or changing the Color of a Series in a Charting.Chart object? I have some of these changes occuring in a worker thread without any issues (so I guess they are ok?), but I'm trying to distinguish which changes are explicity required on the GUI thread and which changes can occur on the

C# Threading using invoke, freezing the form

我与影子孤独终老i 提交于 2019-12-18 16:49:29
问题 I'm trying to use threads and prevent the program from freezing while the thread is busy. It should show the progress (writing of 0's / 1's) and not just show the result after its done, freezing the form in the meanwhile. In the current program I'm trying to write to a textbox, and actually see constant progress, and the form can't be affected by the tasks of the other thread. What I have now is I can write to a textbox with a thread using invoke, but It only shows the result (Form freezes

Is there a general “backend” library for Java reflection

两盒软妹~` 提交于 2019-12-18 11:54:08
问题 I'm currently working with a specialized, interpreted, programming language implemented in Java. As a very small part of the language, I'd like to add the ability to make calls into Java. Before I dive into all of the nitty-gritty of reflection, I was wondering if anyone knew of a general library for doing the "backend" part of invoking Java code reflectively. That is, I parse a string (I define the grammar) into some data structure that represents a Java method call (or constructor, or field

Should I use Invoke or SynchronizationContext to update form controls from another thread?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 08:48:44
问题 Trying to wrap my head around updating UI controls from other threads. Currently using BeginInvoke and honestly it's working fine but I keep hearing about how you can use SynchronizationContext as well to do the same thing. Which is preferred? Also, is it bad practice to update the UI from a thread? Would it be better to raise an event and have the main form handle it instead or are there other preferable ways to do that as well? Sorry for the somewhat subjective question but there are so

How to “invoke” a class instance in PHP?

不想你离开。 提交于 2019-12-18 05:51:20
问题 is there any possibility to "invoke" a class instance by a string representation? In this case i would expect code to look like this: class MyClass { public $attribute; } $obj = getInstanceOf( "MyClass"); //$obj is now an instance of MyClass $obj->attribute = "Hello World"; I think this must be possible, as PHP's SoapClient accepts a list of classMappings which is used to map a WSDL element to a PHP Class. But how is the SoapClient "invoking" the class instances? 回答1: $class = 'MyClass';

C# compile error: “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.”

折月煮酒 提交于 2019-12-18 04:11:07
问题 I just posted a question about how to get a delegate to update a textbox on another form. Just when I thought I had the answer using Invoke...this happens. Here is my code: Main Form Code: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Data.OleDb; using System.Collections.Specialized; using System.Text; using System.Threading; delegate void logAdd(string message); namespace