471,570 Members | 936 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

How to Marshal a string array

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.
Feb 2 '06 #1
1 2300
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Blue Ice" <no******************@the.newsgroup> wrote in message
news:uH*************@tk2msftngp13.phx.gbl...
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.

Feb 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by jurot | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.