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
Post a Comment