I'm using IActiveScript.AddNamedItem() to add variable to the script
and then keeping a list of variables that are currently in scope. When
the engine calls IActiveScriptSite.GetItemInfo(), I respond with the
requested variable if it's in scope. This works when the variable is a
class with member functions and the script makes a call such as "var
v0 = Foo.GetBar();", but doesn't work if the variable is a string,
such as "VarString" and it's used as "SomeFunc(VarString). I'm getting
IActiveScriptSite.OnScriptError() called with "Invalid procedure call
or argument".
Any ideas of how to accomplish scoped string variables?
I've also tried creating the variables by executing script such as
"var VarString = 'something'" by calling IActiveScriptParse32-
>ParseScriptText(). This works, but variables added this way appear to
be globally scoped. I investigated using the parameter pstrItemName,
but this seems to only create one scope, not a hierarchical scoping as
is required.
I realize that I'm probably not providing enough detail here, but
there are so many factors involved that I don't want to overwhelm this
posting. I'm happy to provide more specifics and grateful for any
opinions or hints about how to accomplish this task.