private void btnCreate_Click(object sender, EventArgs e)
{
try
{
IClassFactory factory = (IClassFactory)m_pObject;
object new_object;
Guid IID_IUnknown = COMInterfaceEntry.IID_IUnknown;
Dictionary<string, string> props = new Dictionary<string, string>();
props.Add("Name", m_objName);
factory.CreateInstance(null, ref IID_IUnknown, out new_object);
ObjectInformation view = new ObjectInformation(m_registry, m_objName, new_object,
props, m_registry.GetInterfacesForObject(new_object));
Program.GetMainForm().HostControl(view);
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}