I am using C# to call a DLL function.
[DllImport("MyDLL.dll", SetLastError = true)]
public static extern uint GetValue(
pHandle handle,
ref somestruct a,
ref somestruct b);
How can I pass a null
reference for argument 3?
When I try, I am getting a compile-time error:
Cannot convert from
<null>
to ref somestruct.
I also tried IntPtr.Zero
.
ref
parameter? So why don't you show us the exact method signature? Issomestruct
really a struct or a class? – Slim