Forum: JRuby parameter as Array is empty jruby-ole32

87f380c90154a04d83a3ce78ec35c878?d=identicon&s=25 Antonio Castellon (antonio_c66)
on 2013-09-23 17:03
Dear developers,

I'm testing to connect with a DLL created in C# with this simple
strcuture:

[ C# CODE ]...................................................

 public interface ICore
 {
        [System.ComponentModel.Description("... array test")]
        void MyTest(string[] str);
 }

 public class Core : ICore
 {
        public void MyTest(string[] strArray)
        {
            foreach(string str in strArray)
            {
                Console.WriteLine(" >> [" + str + "]");
            }
        }
 }
...................................................

Then I defined the next array to be pass to the method defined.

[Ruby code]...................................................

 libs = ['one', 'two']

 lib3 = WIN32OLE.new('MyCoreDLL.Core')
 lib3.MyTest(libs);

...................................................

But the result is empty when it is displayed in the C# method...it
contains the same number of objects than the array..but the data
contained is always blank.

C:\DEV\MyCoreDLL>jruby test.rb
["one","two"]
 >> []
 >> []


Any idea?


Thanks in advance
Antonio
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.