int WINAPI RmuGetReceived (HANDLE hCom, UCHAR* uLenUii, UCHAR* uUii);
//HANDLE hCom:通信端口句柄。
//UCHAR* uLenUii:标签UII 的长度,1 个字节。
//UCHAR* uUii:标签UII,至少66 个字节。
[DllImport("API.dll", EntryPoint = "RmuGetReceived")]
public static extern int RmuGetReceived(int hCom,ref byte uLenUii, ref byte[] uUii);
byte uLenUii= new byte();
byte[] uUii= new byte[66];
int ret = API.RmuGetReceived(comm.hComm,ref uLenUii,ref uUii);

解决方案 »

  1.   


    [DllImport("API.dll", EntryPoint = "RmuGetReceived")]
    public static extern int RmuGetReceived(int hCom, [Out, MarshalAs(UnmanagedType.LPArray)]byte uLenUii, [Out, MarshalAs(UnmanagedType.LPArray)]byte[] uUii);=====
    byte uLenUii= new byte();
    byte[] uUii= new byte[66];
    int ret = API.RmuGetReceived(comm.hComm,uLenUii,uUii);有异常NotSupportedException
      

  2.   

    [DllImport("API.dll", EntryPoint = "RmuGetReceived")]
    public static extern int RmuGetReceived(int hCom,ref byte uLenUii, ref byte[] uUii);
    byte uLenUii= new byte();
    byte[] uUii= new byte[66];
    int ret = API.RmuGetReceived(comm.hComm,ref uLenUii,ref uUii);