|
C#: How do I pass in a object array to a C Dll using Marshal?
Hi all...
I have a local class
private class ComplexNum: object
{
System.Double re, im;
public niComplexNum()
{
this.re = 0;
this.im = 0;
}
}
I call into a C dll which has a output array of CompleNum[]. After doing some research, I think I am doing something incorrect with the marshalling of the data
for eg... say my function signature is void foo(ComplexNum[] data)
I was trying to use the MarshalAs directive for the ComplexNum parameter -
[MarshalAs(UnmanagedType.LPArray)] ComplexNum[] data
but that doesn't seem to be working. I get a NullReferenceException ..
any ideas why?
|