Unmanaged Struct Array Pointer

B

bbembi_de

Hello,

I want to use this C++ method in C#:

int doSomething(MyStruct*** structArray);

MyStruct is a struct and MyStruct *** is a pointer to an array of
pointer of my structs.

How can I use that in C#?

I have the struct definded in C# but this doesn't work:

[DllImport("MyDll.dll")]
public static extern int doSomething(ref MyStruct [] structArray);

Help please.

bye bembi
 
M

Mattias Sjögren

I have the struct definded in C# but this doesn't work:
[DllImport("MyDll.dll")]
public static extern int doSomething(ref MyStruct [] structArray);

Is it an input and/or output array and how long is it? This may or may
not work

public static extern int doSomething(ref IntPtr[] structArray);


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top