none
C# marshalling array of structure which has string member s RRS feed

  • Question


  • struct Test

    {

    CHAR Buffer1[256];

    CHAR Buffer2[256]

    }

    I have one requirement where one API returns[out parameter] array of above mentioned structure from C code[DLL].  I need to make a call from c# and get the array of these structure. Someone can help with this.

    Friday, June 13, 2014 11:27 AM

Answers

  • Hello,

    It seems that you are trying to call a dll created by unmanaged C code from C#, is it right?

    If it is, one way is to use the PInvoke Interop Assistant

    There is an example with struct you can refer to:

    http://stackoverflow.com/questions/16065110/porting-c-struct-to-c-sharp

    By the way, this forum is used to ask questions and discussion about data platform development using ADO.NET DataSet and LINQ to DataSet. I do not think your current question is related to this, I think the C# forum would be better if you have same issue, you can post it to there.Questions and discussion about data platform development using ADO.NET DataSet and LINQ to DataSet.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 16, 2014 2:39 AM
    Moderator