• 调用c++接口类


    调用c++接口类

     public class CarDeviceDll
        {
            /*对dll库进行一些初始化*/
            [DllImport("IDI.dll")]
            public static extern int Init_IDI(string IP, int port);
    
            [DllImport("IDI.dll")]
            public static extern int Connect_IDI(string IP, int port);
    
            /*由客户端定时向服务器发送命令,检测连接状态*/
            [DllImport("IDI.dll")]
            public static extern void HeartBeat_IDI();
    
            /*从服务端接受数据*/
            [DllImport("IDI.dll")]
            public static extern int Recv_IDI(ref Client_Data rec);
    
            [DllImport("IDI.dll")]
            public static extern int QuideInfo_Check(byte DoorNo);
    
    
            [DllImport("IDI.dll")]
            public static extern int GetPic_From_Server_IDI(byte[] name, byte[] pic, int len);
    
            [DllImport("IDI.dll")]
            public static extern int GetPerson_From_Server_IDI(byte[] name, byte[] pic, int len);
    
            [DllImport("IDI.dll")]
            public static extern int Send_IDI(string sed,int iLen);
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct Client_Data_Head 
            {
                public UInt16 wHeader;
                public int iReserved;
                public byte byCommand;
                public  UInt16 wDataLen;
            }
    
    
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct Client_Data
            {
                public UInt16 wHeader;
                public int iReserved;
                public byte byCommand;
                public UInt16 wDataLen;
                
                [MarshalAs(UnmanagedType.ByValTStr,SizeConst=160)]
                public string szData;
            }
    
            [StructLayout(LayoutKind.Sequential, Pack = 1)]
            public struct PClientData
            {
                public UInt16 wHeader;
                public int iReserved;
                public byte byCommand;
                public UInt16 wDataLen;
                
                [MarshalAs(UnmanagedType.ByValTStr,SizeConst=160)]
                public string szData;
            }
    
        }
  • 相关阅读:
    3.python函数编程-reduce函数
    2.python函数编程-filter函数
    1.python函数式编程-map函数
    匿名函数
    函数作用域
    风湿理论
    关于ProjectServer调用PSI 报Error GeneralReadOnlyColumn (20005)
    ProjectServer任务审批后自动发布
    ProjectServer如何让系统管理员模拟普通用户创建自己的时间表
    如何对Project Proffesional设置预警灯
  • 原文地址:https://www.cnblogs.com/markli/p/3581946.html
Copyright © 2020-2023  润新知