Hi everyone. I gotta pass an InParameter from my C# application to an exported function from a VC++ DLL. The function accepts 2 parameters :
int func_name (FILE* fp, BYTE& by);
fp is In and by is Out parameter.
I was thinking of marshaling using IntPtr for the FILE* and using byte for BYTE. Is it correct? If I write the following in C#
[DllImport("name_of_project.dll", CharSet = CharSet.Ansi)] public static extern int func_name(IntPtr FilePointer, [MarshalAs(UnmanagedType.BYTE&)] byte by);
will it work? I think it will give an error for the '&' sign in the marshaling statement. How do I pass the out parameter by reference?
Your help would be much appreciated.
Thanks,Viren