Urgent : dll function?
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Dear All, I am trying to call a function from an Intel dll that's originally written in C/C++. It's original prototype is : HIGHGUI_API IplImage* cvvLoadImage( const char* filename ); I have marshalled it as : [DllImport("highgui.dll")] [return : MarshalAs(UnmanagedType.Struct)] unsafe public static extern IplImage * cvvLoadImage(string filename); when I try to run it ,I get the following error.Does anyone know how can I fix that? Error: Cannot take the address or size of a variable of a managed type ('IplImage') I have marshaled the originally struct IplImage into : [StructLayout(LayoutKind.Sequential)] unsafe public struct IplImage { .... }; Best Regards, E.A.