D
Dilip Krishnan
Hi I'm having a function in a Dll that has the following signature.
int foo(void **ppSomeHandle, char *str1, char* str2)
I was wondering whats the best way to access it in managed code. In C#
how would I define the same
[DllImport....]
public static extern unsafe int foo(IntPtr *ppSomeHandle, string str1,
string str2);
OR
[DllImport....]
public static extern int foo(ref IntPtr pSomeHandle, string str1, string
str2);
My main concerns are around the ppSomeHandle parameter. Is the second
option even possible? I was wondering if anyone in the group had some
experience in the calling unmanaged dll functions.
Also just to clarify the intent of the dll function. Its used to
retreive a handle and the assumption is that the function will
initialize the pointer and populate the handle value.
Thanks for your help
int foo(void **ppSomeHandle, char *str1, char* str2)
I was wondering whats the best way to access it in managed code. In C#
how would I define the same
[DllImport....]
public static extern unsafe int foo(IntPtr *ppSomeHandle, string str1,
string str2);
OR
[DllImport....]
public static extern int foo(ref IntPtr pSomeHandle, string str1, string
str2);
My main concerns are around the ppSomeHandle parameter. Is the second
option even possible? I was wondering if anyone in the group had some
experience in the calling unmanaged dll functions.
Also just to clarify the intent of the dll function. Its used to
retreive a handle and the assumption is that the function will
initialize the pointer and populate the handle value.
Thanks for your help