[quoted text, click to view] > The application that I am working on create new objects at run-time and
> attach behavior to these run-time objects by asssociating them with
> JScript. This application is being developed in C#.
>
> To be able to execute the method that are created at runtime (and
> implemented in JScript) I have wrapped the eval function in a
> JScript.NET dll. I send in the script I want to execute to this dll and
> it runs the eval method with the script as parameter.
di you use the second parameter for the eval method ?
cf JScript.NET eval doc
ms-help://MS.NETFrameworkSDKv1.1/jscriptnet/html/jsmtheval.htm
function eval(codeString : String [, override : String])
override
Optional. A string that determines which security permissions to apply to
the code in codeString.
[snip]
[quoted text, click to view] >
> When the first script is executing and calls to my C# class I want to
> evaluate the MethodX script. So I call my wrapped JScript eval function
> and then get a an exception saying that the JSOBject cant be converted
> to IActionObject.
>
> This error message didnt really help me so I started to dig deeper and
> it looks like when the prototype object calls my c# method it puts
> itself on the ScopeStack. The first thing the JScript.Net interpreter
> does when evaluating a script it pushes a new stack frame on its
> internal stack.
>
> To me it looks like you cant use a prototype object when you want to
> call to c# call and then do a new eval.
well, it depends of how you compiled your JScript.NET dll
did you use /fast- option ?
because eval in fast mode has not the same behaviour than in classic (fast-)
mode
[quoted text, click to view] > Have anyone ever had this problem before? I am very thankful for any
> help or guidance I can get in this area. Maybe there is a better way of
> doing? etc...
>
use codeDOM for example
zwetan