all groups > dotnet interop > november 2006 >
You're in the

dotnet interop

group:

Native method that returns multiple strings


Native method that returns multiple strings Tamas
11/27/2006 12:00:00 AM
dotnet interop:
I need to call a method in a C DLL that looks like this:

void GetSuggestList(LPTSTR buffer, int size);

I need to pass a preallocated buffer to the method, which returns =
multiple zero terminated strings in "buffer", an empty string =
terminating the sequence of the strings.

How do I configure the Pinvoke definition to get all strings back? I =
tried StringBuilder but I get only the first string back.

Thanks
Re: Native method that returns multiple strings Mattias Sjögren
11/27/2006 8:56:50 PM
[quoted text, click to view]

You can use a char[] or byte[] as the parameter type.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button