Beispiel #1
0
        public void Parse(string s)
        {
            Type anytype = typeof(MSG_TB_CODFILES);

            byte[] rawdatas = Encoding.GetEncoding(936).GetBytes(s);
            int    rawsize  = Marshal.SizeOf(anytype);

            if (rawsize > rawdatas.Length)
            {
                _MSG_TB_CODFILES = new MSG_TB_CODFILES();
            }
            IntPtr buffer = Marshal.AllocHGlobal(rawsize);

            Marshal.Copy(rawdatas, 0, buffer, rawsize);
            object retobj = Marshal.PtrToStructure(buffer, anytype);

            Marshal.FreeHGlobal(buffer);
            _MSG_TB_CODFILES = (MSG_TB_CODFILES)retobj;
        }
Beispiel #2
0
 public tb_codfiles(MSG_TB_CODFILES ___MSG_TB_CODFILES)
 {
     _MSG_TB_CODFILES = ___MSG_TB_CODFILES;
 }