Passing array from JScript to COM object: Error converting argument 1 to type class StringArray #630
Unanswered
FrankLeinbach
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have run into a breaking issue in moving from an implementation I made of IActiveScript to ClearScript.
I have JScript that creates a COM object like this:
var thirdPartyObj = new ActiveXObject("ThirdPartyObj.API");
within the script, I also create an array of strings to pass to a method on this object:
In the previous iteration, I had a problem directly calling the third party object's method with this array, like this:
thirdPartyObj.ProcessStrings(stringData)
This gave me an error. To circumvent this, I created a global host object function that simply took the JavaScript array and returned an array of String (string[]).
thirdPartyObj.ProcessStrings(JSArrayToStringArray(stringData))
;This worked in the original IActiveScript implementation.
Now, with ClearScript, every time I pass this to the ProcessStrings function, regardless of passing it directly or wrapping the array in the function, I get the error "Error converting argument 1 to type class StringArray".
I have tried a number of engine properties, but none have worked:
Any insight would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions