How to Marshal a string array

  • Thread starter Thread starter Blue Ice
  • Start date Start date
B

Blue Ice

Hello,

I am writing an application that uses libMySQL.dll, which is unmanaged C
code. I try to use this in my C# app, however a function called
mysql_fetch_row returns an array of strings and I don't know how to get that
converted to managed code. Can someone explain this to me? I am not
experienced and I am still learning (just need a challenge). But this is a
bit too much for me without clear information.

TIA,
Arjan.
 
Arjan,

It depends on how the array is passed back. Do you pass in a double
pointer, and the memory is allocated for the array in the function? Or do
you allocate the memory for the array and then it populates the array from
there?

Can you show the C header file? It would make it easier to give you a
declaration in C# to use then.
 
Back
Top