Hello,
I have a problem of communication between JScript and C#. I must say
that I'm new to both.
In a JS file I have to call a C# function.
In particular I have:
public function Eval(expr : String) : String
{
return eval(expr);
}
And I want to call:
Eval("MyNS.myFunction()");
where myFunction is declared in a C# file, under the namespace MyNS,
and returns a string.
Is it possible to do such a thing without to consider COM objects
(which I've heard to be used in similar problems)?
Note that the .js file is generated dinamically by a CodeDomProvider in
C#.
It is compiled by adding the reference of the .exe file, which contains
myfunction():
parameters.ReferencedAssemblies.Add("MyApp.exe");
So the call Eval("MyNS.myFunction()"); will be done with Reflection
One more question: is there another way to use the jscript function
eval in C#? Maybe compiling a .js module (not dinamically and not using
reflection) that can be used by a C# module?
Thank you.
Alessandro