C# marshal array of structs to function in c dll as output parameter -


i call function in c dll, c# application, takes fixed array of structs function argument, , modifies data.

[dllimport("my_c_program.dll",  callingconvention=callingconvention.cdecl)] public static extern int getdata([marshalas(unmanagedtype.lparray,                                             arraysubtype = unmanagedtype.struct,                                             sizeconst=4)]                                  mydatastruct[] mydata); 

i make call function

   mydatastruct [] mydataarrayofstructs = new mydatastruct[4];    getrangingmeasurementdata(mydataarrayofstructs); 

and can confirm function receives array , modifies data, however, following completion of function, returned array unchanged.

can please advise doing wrong.

thanks.


Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -