Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For example I have the following code (input by user):
10*2
I have to include it in my dynamic source code like as:
C#
//using ...
"public float Calc() {
return " + myTextBox.Text + "; }"
Now after building the dynamic assembly, I can invoke it using Type.InvokeMember, but I want to get the result returned by the method invoked (as with the above input, I want to get the value 20), could you please tell me how to achieve that? Do we have to invoke the method without using Type.InvokeMethod?
Your help would be appreciated!
Thanks!
Posted
Updated 27-Mar-12 10:58am
v2

1 solution

If you read the documentation[^] you may notice this

Return Value

Type: System.Object
An object representing the return value of the invoked member
 
Share this answer
 
Comments
supernorb 27-Mar-12 14:10pm    
Thank you!
I should've noticed the definition of InvokeMember method.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900