OleLoadFromStream() 공개 정적인 메소드

public static OleLoadFromStream ( Stream stm ) : object
stm Stream
리턴 object
예제 #1
0
 private async void btnLoadFromStream_Click(object sender, System.EventArgs e)
 {
     try
     {
         MemoryStream stm = new MemoryStream(hexEditor.Bytes);
         Guid         clsid;
         object       obj = COMUtilities.OleLoadFromStream(new MemoryStream(hexEditor.Bytes), out clsid);
         await EntryPoint.GetMainForm(m_registry).HostObject(m_registry.MapClsidToEntry(clsid), obj, false);
     }
     catch (Exception ex)
     {
         EntryPoint.ShowError(this, ex);
     }
 }
예제 #2
0
        private void menuObjectFromSerializedStream_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter = "All Files (*.*)|*.*";

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        using (Stream stm = dlg.OpenFile())
                        {
                            OpenObjectInformation(COMUtilities.OleLoadFromStream(stm), null);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
예제 #3
0
        private async void menuObjectFromSerializedStream_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter = "All Files (*.*)|*.*";

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        using (Stream stm = dlg.OpenFile())
                        {
                            Guid   clsid;
                            object obj = COMUtilities.OleLoadFromStream(stm, out clsid);
                            await HostObject(m_registry.MapClsidToEntry(clsid), obj, obj is IClassFactory);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }