usamaalam
Sep 29th, 2005, 08:22 AM
Hello everybody,
I am getting following exception while opening a form in a separate thread.
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll
Additional information: Class not registered
Exception throws on following line in InitializeComponent() method.
this.Load += new System.EventHandler(this.frm_DesingTemplate_Load);
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).EndInit();
Here is the code for sending methods on thread.
private void PrintAndDraw(bool IsDrawDrawing,bool IsPrintReport)
{
try
{
if(IsPrintReport)
{
ThreadStart reportThreadStart = new ThreadStart(PrintWorkOrder);
Thread reportThread = new Thread(reportThreadStart);
reportThread.Start();
}
if(IsDrawDrawing)
{
ThreadStart drawingThreadStart = new ThreadStart(DrawDrawing);
Thread drawingThread = new Thread(drawingThreadStart);
drawingThread.Start();
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Here is the method under which exception is thrown.
private void DrawDrawing()
{
long ComplaintCode = Convert.ToInt64(this.clsComplaintCode);
int ModelCode = Convert.ToInt32(this.cboMCModel.SelectedValue);
int ManufacturerCode = Convert.ToInt32(this.cboMCManufacturer.SelectedValue);
string strWOrder = txtMCWorkOrder.Text;
frm_DesingTemplate frmComp = new frm_DesingTemplate(ComplaintCode , ModelCode, ManufacturerCode, strWOrder);
frmComp.Show();
}
Exception is thrown in the InitializeComponent() of frm_DesingTemplate form. A visio drawing control has been used on this form.
Any ideas to resolve this issue ??
Thanks.
I am getting following exception while opening a form in a separate thread.
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll
Additional information: Class not registered
Exception throws on following line in InitializeComponent() method.
this.Load += new System.EventHandler(this.frm_DesingTemplate_Load);
((System.ComponentModel.ISupportInitialize)(this.axDrawingControl1)).EndInit();
Here is the code for sending methods on thread.
private void PrintAndDraw(bool IsDrawDrawing,bool IsPrintReport)
{
try
{
if(IsPrintReport)
{
ThreadStart reportThreadStart = new ThreadStart(PrintWorkOrder);
Thread reportThread = new Thread(reportThreadStart);
reportThread.Start();
}
if(IsDrawDrawing)
{
ThreadStart drawingThreadStart = new ThreadStart(DrawDrawing);
Thread drawingThread = new Thread(drawingThreadStart);
drawingThread.Start();
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Here is the method under which exception is thrown.
private void DrawDrawing()
{
long ComplaintCode = Convert.ToInt64(this.clsComplaintCode);
int ModelCode = Convert.ToInt32(this.cboMCModel.SelectedValue);
int ManufacturerCode = Convert.ToInt32(this.cboMCManufacturer.SelectedValue);
string strWOrder = txtMCWorkOrder.Text;
frm_DesingTemplate frmComp = new frm_DesingTemplate(ComplaintCode , ModelCode, ManufacturerCode, strWOrder);
frmComp.Show();
}
Exception is thrown in the InitializeComponent() of frm_DesingTemplate form. A visio drawing control has been used on this form.
Any ideas to resolve this issue ??
Thanks.