Link to home
Start Free TrialLog in
Avatar of bella28
bella28

asked on

System.ComponentModel.Win32Exception: Class already exists

Hi, I have written a small c# class (.dll) that takes html string removes all the HTML tags sends it back to me in rtf format.  I have getting following error on .aspx page that calls this dll.
--------------------------------------------------------------------------------------------
Class already exists
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: Class already exists

Source Error:


Line 23:             thisString = Request.Form["rctext"].ToString();
Line 24:             retVal = new TextToRtf(thisString);
Line 25:             retVal.textToRTF();
Line 26:             outString = retVal.getRTF();
Line 27:             Response.Write("Member ID: " + Request.Form["thisindid"].ToString());
 

Source File: D:\InetPub\wwwroot\aednet\www\leadership\textrtf.aspx    Line: 25

Stack Trace:


[Win32Exception (0x80004005): Class already exists]
   System.Windows.Forms.WindowClass.RegisterClass() +1091
   System.Windows.Forms.WindowClass.Create(String className, Int32 classStyle) +181
   System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) +215
   System.Windows.Forms.Control.CreateHandle() +213
   System.Windows.Forms.Control.get_Handle() +60
   System.Windows.Forms.Control.CreateHandle() +200
   System.Windows.Forms.TextBoxBase.CreateHandle() +54
   System.Windows.Forms.Control.get_Handle() +60
   System.Windows.Forms.RichTextBox.ForceHandleCreate() +5
   System.Windows.Forms.RichTextBox.set_SelectedText(String value) +13
   System.Windows.Forms.TextBoxBase.AppendText(String text) +105
   TextToRtf.TextToRtf.textToRTF() in c:\documents and settings\csh\my documents\visual studio projects\texttortf\class1.cs:30
   ASP.textrtf_aspx.Page_Load() in D:\InetPub\wwwroot\aednet\www\leadership\textrtf.aspx:25
   System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +10
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750
----------------------------------------------------------
Please Help.
ASKER CERTIFIED SOLUTION
Avatar of surajguptha
surajguptha
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bella28
bella28

ASKER

I am trying to convert all text into rtf format.....

Please help
Avatar of bella28

ASKER

I have resolved this issue.

All I had to do was use custom RichTextBox (RichTextBoxEx) I purchased and update my framework form 1.1 to 2 (or 3).

Thank You