Accessing properties in an ActiveX object through Silverlight/JavaScript -


I have written an ATL / Active X object that exposes various properties and methods through its COM interface. I want to be able to access those methods and properties from the Silverlight application. The problem I am running is that I can access methods in Silverlight / C #, but I have not detected the correct syntax for accessing its properties.

In other words, my Silverlight C # code looks something like this:

  var ax = HtmlPage.Document.CreateElement ("object"); Ax.id = "myControl"; Ax.SetAttribute ("Style", "Width: 1px; Height: 1px;"); Ax.SetAttribute ("Classic", "CLSID: 42832F4C-3480-4450-A6B5-156B 2 EFC 408F"); HtmlPage.Document.Body.AppendChild (Ax); // This works ax.Invoke ("SomeMethod", "param1", "param2"); // Each of these "Failed to invoke" Invalid Operation Expression AX Invoke ("some property"); Ax.Invoke ("SomeProperty", "propertyValue"); Ax.Invoke ("get_SomeProperty"); Ax.Invoke ("put_SomeProperty", "propertyValue");  

I can definitely write a pure JavaScript wrapper around AX objects, and I can open javascript functions from Silverlight, and I can still do this.

Any suggestions?

OK, the solution was clear, I have not seen it so far. The correct syntax is:

  ax.GetProperty ("SomeProperty"); Ax.SetProperty ("SomeProperty", "Property Value");  

Duh.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -