c# - How to marshall LPSTR** in .NET? -


i have method in unmaged com object i'm trying marshall:

stdmethod(somemethod)(lpstr** items, int* numofitems) = 0; 

but can't figure out right way marshal out lpstr** items. it's supposed list of items. if try this:

[preservesig]  int somemethod([marshalas(unmanagedtype.lpstr)]ref stringbuilder items, ref uint numofitems); 

i first letter of first item , nothing else.

how can marshal lpstr** variable correctly?

i cannot check right now, signature should this:

[preservesig] int somemethod(     [marshalas(unmanagedtype.lparray, arraysubtype = unmanagedtype.lpstr, sizeparamindex = 1)] out string[] items,     out int numofitems); 

of course, doesn't help, can perform manual marshalling via marshal class (as sinatr suggested).


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -