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
6
votes
8 answers

Help with understanding C# syntax while Invoking a new Action

I am new to c# and do not understand the syntax of invoking a new action or even what an action is. From my understanding in Port1_DataReceived, I have to create an action because I am in a new tread... Can anyone elaborate on why I need to do this?…
Richard
  • 15,152
  • 31
  • 85
  • 111
6
votes
2 answers

How do I access React component's local state using Cypress?

I'm using react with redux and testing with cypress, I was able to access the store using cy.window().its('store').invoke('getState').then((state) => {} But how do i access a component's local state rather than the application store? I tried…
Omar
  • 116
  • 1
  • 3
  • 10
6
votes
2 answers

Can I pass path parameters using lambda invoke to another lambda function?

I'm trying to call and get the response from another lambda function using lambda invoke. The problem is other lambda function needs the id to be sent as path parameters (or as a query string). But I do not see an option in lambda invoke for this.…
Yasith Prabuddhaka
  • 859
  • 1
  • 11
  • 17
6
votes
0 answers

information not available, No symbols loaded for .dll

I applied Invoke to use object of an application in C++ but an error occurred. error:information not available, No symbols loaded for GPNSAutomation.dll My codes is : ::CLSIDFromProgID(OLESTR("SGNSAutomation.SGNSApplication"), &clsid); IID iid; …
mahdi Lotfi
  • 316
  • 3
  • 13
6
votes
4 answers

VB.net ApplicationFramework plus SplashScreen: InvalidOperationException

I recently changed my app from using a custom SplashScreen (it was just a Form with a Timer loaded the main form and closed itself) to the Application Framework. Here is what I did: Created a new SplashScreenForm that shows the app version…
Jürgen Steinblock
  • 30,746
  • 24
  • 119
  • 189
6
votes
3 answers

why does the method invoke() in InvocationHandler have an parameter Object proxy?

When you r checking out that the method invoke(Object proxy, Method method, Object[] args) declaration & the doc statement,you will find that the input parameter proxy proxy - the proxy instance that the method was invoked on when I am doing a…
Eric Chen
  • 79
  • 3
6
votes
1 answer

BeginInvoke with/without using MethodInvoker—does it make any difference?

I've seen these 2 versions of code while looking at some other developers' code: 1. Me.BeginInvoke(New MethodInvoker(Sub() cbo.ShowPopup())) 2. Me.BeginInvoke(Sub() cbo.ShowPopup() End Sub) Are both…
MJ Khan
  • 1,696
  • 3
  • 21
  • 36
6
votes
3 answers

Interview Question: When Control.InvokeRequired do you use Control.Invoke or Control.BeginInvoke?

I have had recently one of those really bad interviews, where they play good cop/bad cop with you. Whatever I replied wasn't good enough for one of them and my confidence was shrinking minute by minute. His final question that really confused me was…
Houman
  • 64,245
  • 87
  • 278
  • 460
6
votes
0 answers

signalR How to call server method from .net client

I want to pass arguments from .net client(Xamarin Android) to hub server. I call server method in serverHub by method "invoke" HubServer code: public class ConversationHub : Hub{ public void SendChatMessage(int conversationId, int messageId, string…
Ihor Levkivskyi
  • 341
  • 5
  • 14
6
votes
7 answers

Inheritance and overloading in Java

I'm studying for an exam and I need some help to understand what is going on in the following snipped of code. class A { public void method1(A X) { System.out.println("A"); } } class B extends A { public void method2() { …
Asker
  • 431
  • 5
  • 14
6
votes
1 answer

Testing Exceptions using Java Reflection Junit4

I have a function which returns an exception and i am writing a unit test case for it in Junit4. The issue is, reflect.invoke always wraps the exception in InvocationTargetException and hence unable to check the exception using ExpectedException…
shardy
  • 357
  • 2
  • 6
6
votes
2 answers

How to invoke a delegate with a null parameter?

I get a null exception if I try to pass a null parameter to a delegate during an invoke. Here's what the code looks like: public void RequestPhoto() { WCF.Service.BeginGetUserPhoto(Contact.UserID, new…
Rodney Burton
  • 427
  • 8
  • 18
6
votes
2 answers

"System.InvalidOperationException: The object is currently in use elsewhere" - how do I resolve this?

I got this error when trying to update an image. It was a cross-thread update, but I used .Invoke(), so that shouldn't be the problem, should it.
Benjol
  • 63,995
  • 54
  • 186
  • 268
6
votes
2 answers

How do I work around the error "ByRef return value not supported in reflection invocation" in C#?

I have a .Net library supplied by a third party. I did reflection on one of their classes and found a member method. The signature was... Byte& FooBar() So, I wanted to call this method through reflection and got the exception "ByRef return value…
Les
  • 10,335
  • 4
  • 40
  • 60
6
votes
1 answer

What is the difference between pipeline.invoke and powershell.invoke?

I am using powershell commands to execute scripts and cmdlets. So while executing cmdlets I used powershell.invoke and while executing a script I used pipeline.invoke method. I wanted to know if there is any difference between the…
cmm user
  • 2,426
  • 7
  • 34
  • 48