3

I'm working with some code in C#.NET for an Internet Explorer extension that calls Javascript in the browser and gets the return value from the Javascript call. When the Javascript returns a primitive type or an array of primitive types, I get something that I can deal with, but when the Javascript returns an object, I get an opaque COM object.

How can I get at the contents of the COM object, or is there a better way to call into IE from C#.NET?

1 Answer 1

2

Take a look at the remarks at the bottom of the InvokeMember documentation. If the return value is a javascript object, you are receiving a .NET Object wrapper around the javascript object. You will have to use reflection to inspect/invoke the members of the underlying javascript object. This makes perfect sense, since javascript is a dynamic language and C# is not.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.