110,538
社区成员
发帖
与我相关
我的任务
分享
public static extern int Plat_GetAllControlCell(int iUserHandle, int iNeedGetNum, [Out, MarshalAs(LPArray, SizeParamIndex=1)] PLAT_CONTROLCELLINFO pCellBuffer[], [Out]ref int pOutputNum) ;
我更加觉得 C++ 参数 的 Buffer 是期望一个数组。[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
public struct PLAT_CONTROLCELLINFO {
/// int
public int iControlCellID;
/// int
public int iParentCellID;
/// char[128]
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst=128)]
public string csControlCellName;
}
public partial class NativeMethods {
/// Return Type: int
///iUserHandle: int
///iNeedGetNum: int
///pCellBuffer: LPPLAT_CONTROLCELLINFO->_tagControlCellInfo*
///pOutputNum: int*
[System.Runtime.InteropServices.DllImportAttribute("<Unknown>", EntryPoint="Plat_GetAllControlCell")]
public static extern int Plat_GetAllControlCell(int iUserHandle, int iNeedGetNum, ref PLAT_CONTROLCELLINFO pCellBuffer, ref int pOutputNum) ;
}
PLAT_CONTROLCELLINFO pCellBuffer = new PLAT_CONTROLCELLINFO();
int PlatRtnCell = 0;
PlatInterface.Plat_GetAllControlCell(g_iLoginHandle, 0, pCellBuffer, ref PlatRtnCell);
new个结构体了再传