i have the dllimport as below: [DllImport("DS40xxSDK.dll")] private static extern int SetOsdDisplayModeEx(IntPtr hChannelHandle,int color,bool Translucent,int param,int nLineCount,ushort[][] FormatArray); and call it as below: private void myFunc() { int number=OSDStrings.Length; ushort [] [] FormatArray=new ushort[number][]; for(int i=0;i