• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1000
  • Last Modified:

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.
  • 2
1 Solution
It appears that the code that you are trying to update the richtextbox with the value from the page. Try changing this richtextbox to a normal text box, see what happens?
bella28Author Commented:
I am trying to convert all text into rtf format.....

Please help
bella28Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now