Questions tagged [invoke]

Executes the specified delegate on the thread that owns the control's underlying window handle.

The Invoke method searches up the control's parent chain until it finds a control or form that has a window handle if the current control's underlying window handle does not exist yet. If no appropriate handle can be found, the Invoke method will throw an exception.

1794 questions
0
votes
1 answer

Accessing Controls in a Thread in Windows CE C# Program

i'm writing a program for WinCE6 in C# , using Network (TCP/IP) and Serialport. i used a thread for socket listening and as data received i want to show it in a label on form. but there is an error for accessing controls in Threads and i wanted to…
0
votes
1 answer

How to invoke a control within a IF statement

I have searched quite a bit looking for how to invoke a control within a if statement for awhile now and haven't been able to find anything on this. I'm sure I'm missing something but if someone could show me how to do this that would be great.…
Timg
  • 227
  • 1
  • 3
  • 12
0
votes
1 answer

Invoke class method with custom parameters using google mock

I'm developing some unit tests on a serial application in c++ using google mock framework. The mock I've built for my serial port interface is: class MockSerialPort: public SerialPortInterface { public: MOCK_METHOD0(Open,…
user2749716
  • 77
  • 1
  • 8
0
votes
0 answers

Calling method with "keyEventArgs" as argument

I have 2 questions. The first main question is how do I fix the error I have when trying to invoke the method that contain KeyEventArgs e as argument. I only know how to deal with arguments when they are variables. The Second is just a quick…
FunBugs
  • 1
  • 1
0
votes
2 answers

Invoking an EXE in same Solution. Can it be a DLL instead?

This is completely outside my experience so excuse me if this is dumb question. I've spent a couple of hours on Google looking for an answer to this and I can't find one that seems to apply directly to my situation. I'm working with a group that…
Richard Schaefer
  • 525
  • 3
  • 13
  • 45
0
votes
1 answer

Scala: Wrong Number of Arguments Exception when invoking method

I am trying to invoke a method reflectively in Scala. But I keep encountering a wrong number of arguments exception, even though the arguments appear to match the method signature. class ReflectionTest { def myConcat (s1:String, s2:String,…
0
votes
3 answers

problem with arguments when running a jar using reflection

I try to run a jar using reflection with the the getMethod and invoke method but ran in trouble with the arguments passed to the invoke method: String mainClass = myprog.Run; String[] args = new String[2]; args[0] = "-a"; args[1] = "-c…
dm76
  • 4,130
  • 8
  • 35
  • 46
0
votes
1 answer

Trouble with params and invoke handler

I'm trying to call Invoke with a array as parameter. The problem is that Invoke uses the params - if my array is 3 elements long, Invoke tries to call a method with 3 parameters instead of calling the method with one ARRAY parameter: private void…
joe
  • 8,344
  • 9
  • 54
  • 80
0
votes
1 answer

Adding nodes to treeview with Begin Invoke / Invoke

I've been working through my first project and have had a great deal a valuable help from the guys on SO but now I'm stuck again. The below sub is used to add TreeNodes to a TreeView, excluding certain filetypes/names, upon addition of new data: Sub…
elmonko
  • 665
  • 2
  • 12
  • 29
0
votes
1 answer

Correct way to call Dispatcher.Invoke

Can anyone explain why the following code works on some Win7 PC's but on some I get a MissingMethodException and the Timer.Elapsed event is never called. Private Sub _timer2_Elapsed(ByVal sender As Object, ByVal e As System.EventArgs) Handles…
Jerry
  • 393
  • 4
  • 8
0
votes
1 answer

Manipulate gui-elements from another thread - Common way to do this?

I've been looking a lot of sites about "manipulate gui-elements from another thread" and each solution i found was (or looks) completely different than the others... Some solutions were 1-3 lines long and other solutions were 50+ lines long. Here…
user3146246
  • 55
  • 2
  • 8
0
votes
2 answers

How do I retrieve a Struct returned via an Invoke C#

I have a DLL which contains a bunch of classes and methods. I'm calling invoke on methods within the DLL which return values. This works fine if i'm trying to return a single value such as a string or int. Now I've come across a situation where I…
Festivejelly
  • 670
  • 2
  • 12
  • 30
0
votes
2 answers

How to call method to avoid cross threaded call

How to call method sendResponse to cross threaded call? void watcher_Created(object sender, FileSystemEventArgs e) { System.Diagnostics.Debug.WriteLine(e.FullPath); sendResponse(e.FullPath); //this method must…
user3196085
0
votes
1 answer

How to run python invoke within python code

I am trying to write up some python code to automate some stuff, and would like to install some ruby gems during the execution. I am reading up Invoke I tried using cli api which documented here, and this is how I am trying to run it: import…
James Lin
  • 25,028
  • 36
  • 133
  • 233
0
votes
2 answers

can event handlers take current object as a parameter?

I have read where an event is triggered on another thread from the one that created the controls on a Windows Form. Therefore, the event handler can't directly update the controls (like changing a button's color). I read the explainations about…
Joe
  • 71
  • 10