MarshalObject() публичный статический Метод

public static MarshalObject ( object obj ) : byte[]
obj object
Результат byte[]
Пример #1
0
        private void btnMarshal_Click(object sender, EventArgs e)
        {
            using (SaveFileDialog dlg = new SaveFileDialog())
            {
                dlg.Filter = "All Files (*.*)|*.*";

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        File.WriteAllBytes(dlg.FileName, COMUtilities.MarshalObject(m_pObject));
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Пример #2
0
 private void btnMarshal_Click(object sender, EventArgs e)
 {
     try
     {
         Program.GetMainForm(m_registry).HostControl(new ObjectHexEditor(m_registry,
                                                                         "Marshal Editor", COMUtilities.MarshalObject(m_pObject, GetSelectedIID(),
                                                                                                                      MSHCTX.DIFFERENTMACHINE, MSHLFLAGS.NORMAL)));
     }
     catch (Exception ex)
     {
         Program.ShowError(this, ex);
     }
 }