I can't seem to find the syntax for Marshaling a propertiy in C#. Here is what I am trying to do
namespace MyNS
public interface IMyClass
string[] strings { get;
public class MyClass : IMyClass
string[] strings
get
string[] str = new string[20]
// fill the str with value
return str
// JSctipt cod
var myClassInst = new ActiveXObject(' MyNS.MyClass'); //O
var strings = myClassInst.str ings; // No error ye
var str1 = strings[0]; // Error, tells me that this is not an arra
Now I tried to put a Marshal statement..
public interface IMyClass
[MarshalAs(Unman agedType.ByValA rray)] string[] strings { get; } // compile erro
....but it won't compile and tells me that I can't use it that way. OK, then how do you use it with properties? And can someone change this example so it will work? Thank
- rashad rivera
namespace MyNS
public interface IMyClass
string[] strings { get;
public class MyClass : IMyClass
string[] strings
get
string[] str = new string[20]
// fill the str with value
return str
// JSctipt cod
var myClassInst = new ActiveXObject(' MyNS.MyClass'); //O
var strings = myClassInst.str ings; // No error ye
var str1 = strings[0]; // Error, tells me that this is not an arra
Now I tried to put a Marshal statement..
public interface IMyClass
[MarshalAs(Unman agedType.ByValA rray)] string[] strings { get; } // compile erro
....but it won't compile and tells me that I can't use it that way. OK, then how do you use it with properties? And can someone change this example so it will work? Thank
- rashad rivera