Questions tagged [dynamic-invoke]

23 questions
1
vote
2 answers

How do I pass an object array into a method as individual parameters?

I have the following code: public class MyClass { private Delegate m_action; public object[] m_args; public MyClass() { } public MyClass(Delegate action, params object[] args) { m_args = args; m_action…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
1
vote
2 answers

Strange behavior with DynamicInvoke and Invoke

I read this post and I tried to do the same but I came across a very strange behavior when comparing the del.DynamicINvoke(args) Vs. del(args) Update So after Jon and usr comments i post now new working code. I'll really appreciate any…
Maya
  • 989
  • 4
  • 12
  • 19
0
votes
0 answers

unable to call generic method through reflection System.Reflection.TargetException: 'Non-static method requires a target.'

I am trying to invoke a Generic method through reflection but it throw an exception Non-Static mehod requires a target here is the method I am using to invoke the generic method public object ExecuteParseTree(Type arg,ParameterExpression param,…
PontiacGTX
  • 185
  • 2
  • 15
0
votes
0 answers

DLLImport vs DinamicInvoke or Method.Invoke in VB.NET

I want to call function MoveFile from "Kernel32.dll". 1)First approach: Imports System.Runtime.InteropServices Public Class Form1
0
votes
1 answer

Thread was canceled on new CookieContainer when dynamically Invoking Method with Task.Factory.StartNew

I begin by loading some dlls in a folder and storing a instance of the Core class together with the name as keys in a Dictionary, like so: const string SEARCH_PATH = "./Cores"; const string FILE_NAME_MASK = "*.core.dll"; …
0
votes
1 answer

Java Method Handles: propagate unbound arguments across functions

I would like to create a method handle that allows me to pass as argument a value that will be bound to a placeholder way down the method handle tree. Figure, something like this: f(x) = plus( minus( x, 2), 3) where x is passed at invoke, and 2 and…
Gui13
  • 12,993
  • 17
  • 57
  • 104
0
votes
1 answer

Dynamic invoke and sleep thread

I've a question about dynamic invoke and threads. Let's suppose that I have a main thread that in some point shows a dialog. public void showDialog() { lock(mutexObject) { flagDialogShowing = true; …
acostela
  • 2,597
  • 3
  • 33
  • 50
0
votes
2 answers

Calling delegates later aka. delegate queue

so I'm pretty new to c# and I've came around this problem: I have some methods that invoke different delegates (with potentially different argument types). However these delegates shouldn't be called right away. If the main Thread is running a…
Yamcha
  • 1,264
  • 18
  • 24
1
2