I am having a struct defined in C++ which contains int and std::string arrays which is a native C++ code (dll). I have used following method to get it in C#:

```
public class PInvokeData
{
    [StructLayout(LayoutKind.Sequential)]        
    public struct pinvoke_call
    {
        //[MarshalAs(UnmanagedType.LPArray,SizeConst=5,SizeParamIndex=0,MarshalType="int")]
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]//,SizeParamIndex =0,SafeArraySubType = VarEnum.VT_I4)]
        public int[] mynum;
    }
    [DllImport("DLL_pinvoke_base.dll")]
    public extern static pinvoke_call TestPInvoke();
}

```

the code compiles well.
when i call this static method and get return value of struct from C++ and assign to another struct object in C# like

```
input = PInvokeData.TestPInvoke();

```

i get exception of MarshalDirectiveException was unhandeled. Method's type signature is not PInvoke compatible. I tryed to solve the problem via other forum threads, but i did not get the result.

the struct in C++ code is same as there shown for C# struct like

```
struct pinvoke_call
{
    int mynum[5]
};

```

After calling a function C++ it returns this structure variable from there to C# which i want to marshal

Thanks for reply,
Ashutosh