Reputation: 5264
There is a function in vc++ dll.
void fun(unsigned int nchannel,int nFGHandle,void* i);
Now I want to call this dll in my c# code. I am using like this,
[DllImport ("AVC.dll")]
public static extern void fun(UInt32 a,int b,ref void c );
So I want to ask
Upvotes: 0
Views: 759
Reputation: 28272
As far as I know, you use IntPtr
to marshal void *
, however, if you need the return value, you can directly use out <type>
and have several overloads, e.g.:
[DllImport ("AVC.dll")]
public static extern void fun(UInt32 a,int b, out int c );
[DllImport ("AVC.dll")]
public static extern void fun(UInt32 a,int b, out float c );
etc.
Upvotes: 2