I have a function in win32 dll with signature as:
void func1(int a, char*** outData)
int a --> input parameter
char*** outData --> output parameter - pointer to array of char strings
Any idea how to access this in C# using dll import & what should be the signature.
For complicated types like triple pointers, I find the best approach is to go simple and marshal it as just a IntPtr
[DllImport("Some.dll")]
private static extern void func1(int a, out IntPtr ptr)
Once this function returns the IntPtr
value will essentially represent a char**
.
Using that value is nearly impossible though because we don't know the length. You'll need to alter your function signature to pass back out the length of the array before it can be used in managed code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With