I have a basic question,
I have a C++ unmanaged dll that have functions with parameters in and out some unsigned char,unsigned short,unsigned long,signed char,signed short, signed long data type.
Do I need to Marshal it or I can directly mapped it? What is the best practice if any?
e.g dll
unsigned long SomeFunc(unsigned char variableA);
C# (direct map in C#)
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U4)]
public static extern uint SomeFunc(byte variableA);