private void menuROTBindToObject_Click(object sender, EventArgs e)
{
if (listViewROT.SelectedItems.Count != 0)
{
MonikerInfo info = (MonikerInfo)(listViewROT.SelectedItems[0].Tag);
Dictionary <string, string> props = new Dictionary <string, string>();
props.Add("Display Name", info.strDisplayName);
props.Add("CLSID", info.clsid.FormatGuid());
try
{
IBindCtx bindCtx = COMUtilities.CreateBindCtx(0);
Guid unk = COMInterfaceEntry.IID_IUnknown;
object comObj;
Type dispType;
info.moniker.BindToObject(bindCtx, null, ref unk, out comObj);
dispType = COMUtilities.GetDispatchTypeInfo(this, comObj);
ObjectInformation view = new ObjectInformation(m_registry, null, info.strDisplayName,
comObj, props, m_registry.GetInterfacesForObject(comObj));
Program.GetMainForm(m_registry).HostControl(view);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}