unsafe private void Form1_Load(object sender, EventArgs e) { //flag初始化 Console.WriteLine("hello 101protocol!"); //Balance101VariousFlag* flag = null; int ret = 0; //赋初值 Balance101VariousFlag *f; // = flag; ret = win_init_RTEFlag_101(&f); //& flag = f; Console.WriteLine("win_init_RTEFlag_101 return " + ret); win_print_flag(flag, sFlag); textBox1.AppendText(sFlag.ToString());//"flag"(string)(flag) Convert.ToString(flag) }
//unsafe public static extern int getFILE(Balance101VariousFlag* rte, ref FILESTRUP file); unsafe public static extern int getFILE(Balance101VariousFlag *rte, IntPtr file);
unsafe public static extern int getCALL(Balance101VariousFlag *rte, ref S_CALL ptr);
//unsafe public static extern int getFILEMENU(Balance101VariousFlag* rte, ref FILESTR menu);//ref unsafe public static extern int getFILEMENU(Balance101VariousFlag *rte, IntPtr menu);
unsafe public static extern int getSOE(Balance101VariousFlag *rte, ref _SOE ptr);
unsafe public static extern int getYK(Balance101VariousFlag *rte, ref _YK ptr);
unsafe public static extern void win_print_flag(Balance101VariousFlag *rte, StringBuilder _sFlag);
unsafe public static extern int win_device_parse_101(Balance101VariousFlag *rte, byte[] buf, int len);//ref u
unsafe public static extern int win_device_101act_yk(Balance101VariousFlag *rte, ref _YK pYk, byte[] buf, int size);
unsafe public static extern int win_device_101act_file(Balance101VariousFlag *rte, ref FILEOPERATE pOper, byte[] buf, int size);//ref
unsafe public static extern int win_device_101act_timesync(Balance101VariousFlag *rte, ref S_TIMESYN pTime, byte[] buf, int size);//ref
unsafe public static extern int win_device_101act_beat(Balance101VariousFlag *rte, byte[] buf, int size);//[In, Out] [In, Out]
unsafe public static extern int win_device_101act_call(Balance101VariousFlag *rte, byte[] buf, uint len);//ref byte[] [In , Out]
unsafe public static extern void win_device_unregister_101(Balance101VariousFlag *rte);
//unsafe public static extern int win_login_Proc_101(Balance101VariousFlag* rte, [In , Out]byte[] buf, [In,Out]uint *len);//ref ref unsafe public static extern int win_login_Proc_101(Balance101VariousFlag *rte, byte[] buf, ref int len);