Hello
I have an external dll component that has a function that takes array of another dotnet object as a parameter.
The function is something like this: sendCustomer(Customer[]).
How can I create .net array that contains custom object. I read at
http://vjeko.com/blog/generics-in-net-interop-for-nav-2013 that you could use array like this:
Arr := Arr.CreateInstance(GETDOTNETTYPE(Type),2);
Arr.SetValue(GETDOTNETTYPE(String),0);
Arr.SetValue(GETDOTNETTYPE(Int),1);
This is not working for me because im using custom DotNet object and the error message I get is that the dotnet array is not initialized.
Does anyone have any solution for me or any example of how to use dotnet array?
Cheers
Comments
jwilder@stonewallkitchen.com
"<Parameter 1>", "<Parameter 2>"
But in NAV it is expecting one dotnet paramter of params String[].
Any thoughts?
jwilder@stonewallkitchen.com
But I also can't get thru it in more complex functions with overloading a nullable params - like BouncyCastleCert[] chain ...
xStepa
ParamsArr DotNet System.Array.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Param1 DotNet System.String.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Param2 DotNet System.String.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
I don't think this addresses the params keyword needed to allow this to not error during runtime. By the way it is the typical not so helpful error when parameters do not match that I get when I run my code:
jwilder@stonewallkitchen.com