Hi all!.

I would like use unmanaged code from C in C#.

I built a DLL with C code with this functions:

struct GetPluginData
{
int data[22];
};

DLLEXPORT extern "C" __declspec (dllexport) GetPluginData GetDataArray(int number);

In C# I've got this code:
[StructLayoutAttribute(LayoutKind.Sequential, Pack=1)]
public unsafe struct GetPluginData
{
/// int[22]
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 22, ArraySubType = UnmanagedType.I4)]
public int[] data;
}

[DllImport("RBRPlugin.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetDataArray")]
[return: MarshalAs(UnmanagedType.Struct)]
public static extern GetPluginData GetDataArray(int number);

In button event or othe place code, I wrote this:
GetPluginData tes = GetDataArray(1);

And I'm getting the error: The type signature of this method is not PInvoke compatible.

I'm looking for information throught google, but no result found...

Thanks in advance!