public static OleLoadFromStream ( Stream stm ) : object | ||
stm | Stream | |
리턴 | object |
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); } }
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); } } } }
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); } } } }