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

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

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -