I try call .net function (copy form PB help Calling .NET Assembly in an Application) imported by .NET DLL Importer
//array argument public void TestByteArray(byte[] bArray) { for(int i = 0; i < bArray.Length; i++) { } }
and get error: Error calling external object function xxxxxxx (V externí součásti došlo k výjimce.) at line 23 in function of_xxxxxxx of object nvo_test_pb.
In help is written that array of base types is supported:
PowerBuilder |
C# |
Array (one and two dimension) |
Reference |
Generic Nullable<T> |
int |
short |
Supported |
Supported |
Supported |
uint |
ushort |
Supported |
Supported |
Supported |
long |
int |
Supported |
Supported |
Supported |
longptr |
int32/int64 |
Supported |
Supported |
Supported |
ulong |
uint |
Supported |
Supported |
Supported |
longlong |
long/Int64 |
Supported |
Supported |
Supported |
boolean |
bool |
Supported |
Supported |
Supported |
char |
string/char |
Supported |
Supported |
Supported |
string |
string |
Supported |
Supported |
Unsupported |
real |
float |
Supported |
Supported |
Supported |
double |
double |
Supported |
Supported |
Supported |
decimal |
decimal |
Supported |
Supported |
Supported |
blob |
byte[] |
Supported |
Supported |
Supported |
Date |
DateTime |
Supported |
Supported |
Supported |
DateTime |
DateTime |
Supported |
Supported |
Supported |
Time |
DateTime |
Supported |
Supported |
Supported |
But in answer:
Powerserver parameters to DotNet Component (appeon.com)
is witten by Marco Meoni: Unfortunately non-primitive type parameters such as arrays are unsupported in AppeonDotNetComponent
How is It?
Thanks.
But I know that and I did it exactly by this.
According to the documentation, the one-dimensional array should have no restrictions.
.NET DLL Importer creates:
//*-----------------------------------------------------------------*/
//* .NET function : TestByteArray
//* Argument:
//* Blob ablo_barray
//* Return : (None)
//*-----------------------------------------------------------------*/
/* .NET function name */
String ls_function
/* Set the dotnet function name */
ls_function = "TestByteArray"
Try
/* Create .NET object */
If Not This.of_createOnDemand( ) Then
Return
End If
/* Trigger the dotnet function */
This.testbytearray(ablo_barray)
Catch(runtimeerror re_error)
If This.ib_CrashOnException Then Throw re_error
/* Handle .NET error */
This.of_SetDotNETError(ls_function, re_error.text)
This.of_SignalError( )
End Try
An error occurs when calling this function on row: This.testbytearray(ablo_barray)