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

On being Invoked by KeyPress, my gameobject appears alright, but does not get invoked again on key press?

I was instantiating and destroying my gameobjects earlier but on learning that it is processor intensive, manipulated my code so that it is an object pool of 1 object. When I press Z, my object gets activated and starts scaling bigger as long as Z…
0
votes
0 answers

PropertyDescriptor getWriteMethod type

I want to call the setter method of an object with a String value which I receive from a resultSet. String value = resultSet.getString(id); try { Method setter = new PropertyDescriptor("field", obj.getClass()).getWriteMethod(); …
priojewo
  • 937
  • 2
  • 11
  • 22
0
votes
1 answer

invoke own private method for the result in jmockit

I got this code in my junit: new NonStrictExpectations(mPersonEvaluator) { { invoke(mPersonEvaluator, "doEvaluatePerson", withAny(String.class), withAny(Integer.class), withAny(Integer.class)); result = doEvaluatePerson((String)any,…
nano_nano
  • 12,351
  • 8
  • 55
  • 83
0
votes
2 answers

Invoking a HTTP URL from perl script - Perl Version 5.8.4

We have perl version 5.8.4 installed on our servers. I am trying to invoke a HTTP URL from within the perl script and based on the output that the HTTP URL returns I have a logic to be executed. I am very new to perl and am looking for help to…
0
votes
1 answer

PHP: Chained '__invoke's on '$this' Cause a Parsing Error

I'm running PHP 5.5.9 and I'm getting a parsing error that I haven't a clue how to resolve. Here's an extremely contrieved example of the technique I'm trying to employ:-
Louis Jackman
  • 1,001
  • 6
  • 16
0
votes
4 answers

In emacs, how do I customise which shell is used to start processes when using M-x comint-run

I run emacs on windows. I use cygwin and I have cygwin versions of ruby and rdebug installed as well. When I invoke M-x comint-run ENTER rdebug ENTER, I noticed that it is attempting to run rdebug.bat via the Microsoft Command prompt, instead of…
Rohith
  • 2,043
  • 1
  • 17
  • 42
0
votes
1 answer

Use of delegates and invoke to call different sub depending on some variable

I would like to organize a class as follows (pseudocode) Class MyClass sub New(MethodEnabled as integer) if MethodEnabled = 0 make MyMethod() to be Sub0() else make MyMethod() to be Sub1() end if end sub sub…
Pam
  • 474
  • 1
  • 4
  • 13
0
votes
1 answer

Invoke method in DLL with C#

How to invoke this method in C# ( it's an method in WD_SDK.dll, it's C++ ) ? WD_RegisterVideoPreviewCB(HANDLE hChannel, PVOID pContext, VideoCaptureCB_Ptr pCB);
user2877989
  • 587
  • 1
  • 6
  • 19
0
votes
1 answer

Trouble to add item to listview from other thread

Basically, the title says it all; im havin a problem in adding my incoming connections to my listview. (I have the addclient function in a separate class that adds a new client to the listview, on accept. Here is the function's code: Delegate…
0
votes
2 answers

Trying to use getElementsByClass in VB.NET..?

I keep getting this error when trying to implement getElementsByClassName.. Error 1 'getElementsByClassName' is not a member of 'System.Windows.Forms.HtmlDocument'. I'm trying to press a button on webbrowser1 by…
0
votes
1 answer

Can Invoke execute main UI thread code that throws exception?

In my code below, I am using Process objects to execute a series of DOS batch files. I'm shortening the list of scripts for example's sake. The subsequent (1+) scripts execute via an event handler (instead of a for loop). That way, each subsequent…
Joe
  • 71
  • 10
0
votes
1 answer

Is it possible to 'overeride' (?) the way my delegate wrapper gets invoked? so instead of meAction.Invoke() I could just do meAction()?

I have a delegate wrapper called SerializedAction [Serializable] public class SerializedAction { private Action action; public void Add (Action handler) {...} public void Remove (Action handler) {...} public void Invoke () {…
vexe
  • 5,433
  • 12
  • 52
  • 81
0
votes
2 answers

updating UI thread using BackGroundWorker in C# Form application

I have a time consuming task that tests a couple of network connections. In my example below I have confined it to one connection. Normally the connection returns quickly but it could happen that the connection cannot be made so that the socket…
Krischu
  • 1,024
  • 2
  • 15
  • 35
0
votes
0 answers

C# callback delegate modifies text, works most of the time

I have a serial port listener (inputStream) that has a callback (DataReceived). When I connect a delegate to it that updates a GUI element, it works fine, given that I have defined the delegate inside the GUI Form, but when I resize the form, I get…
reza
  • 1,329
  • 2
  • 22
  • 37
0
votes
0 answers

pictureBox.Image (strangely) seems to be thread safe

I have a background thread called from a windows form that receives images from a camera and prints them on a picturebox (directly from the secondary thread). It should raise an exception, but everything seems to be ok. I’m using VS 2010 and the…
Giuseppe Dini
  • 762
  • 7
  • 19