Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


System.ComponentModel.Win32Exception: Class already exists

Posted on 2007-10-19
Medium Priority
Last Modified: 2013-12-17
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.
Question by:bella28
  • 2
LVL 21

Accepted Solution

surajguptha earned 2000 total points
ID: 20111989
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?

Author Comment

ID: 20112196
I am trying to convert all text into rtf format.....

Please help

Author Comment

ID: 20112511
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

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question