Free Support Forum - aspose.com

Class Already Exists Problem

I am getting a problem with Aspose Powerpoint when I run the getThumbnail function. It is an intermitant problem. Every so often, I get a Win32Exception of “Class Already Exists”. I’m not doing anything fancy; the problem is almost definitely with AP. Below is a bit of the code. Please, if anyone can help, please do.

Thanks.

Andrew Wied

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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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() +212 System.Windows.Forms.Control.get_Handle() +60 System.Windows.Forms.Control.CreateHandle() +199 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 Aspose.PowerPoint.TextHolder.Draw(Image img) +320 Aspose.PowerPoint.Slide.GetThumbnail(Double scaleX, Double scaleY) +431

Tongue Tied
Ok… I just upgraded to the latest version and now I get a different error, but the same results.

Help, Please!

Thanks,
Andrew Wied

System.ComponentModel.Win32Exception: Error creating window handle.
at
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at System.Windows.Forms.Control.CreateHandle() at System.Windows.Forms.TextBoxBase.CreateHandle() at System.Windows.Forms.Control.get_Handle() at System.Windows.Forms.RichTextBox.ForceHandleCreate() at System.Windows.Forms.RichTextBox.set_SelectedText(String value) at System.Windows.Forms.TextBoxBase.AppendText(String text) at Aspose.PowerPoint.TextFrame.Draw(Image img) at Aspose.PowerPoint.Slide.GetThumbnail(Double scaleX, Double scaleY)

Dear Andrew,

Google suggests to reset IIS.
By the way, do you use GetThumbnail from different threads?
This function is not really thread safe but works in most cases.

Hello, thanks for the quick reply.

Yes, I saw that IIS should be restarted. I have done that myself, and it seems to alleviate the problem… for a while.

The problem is that I can’t really restart the server everytime this problem arises… I’m not using getThumbnail from different threads either… Any other ideas/solutions?

Thanks for your help,
Andrew


Dear Andrew,

Please try new 1.5.10 hot fix.
http://www.aspose.com/blogs/alexey.zhilin/

Hey,
just updated to 1.5.14
and still get this error (even after restarting the IIS)

FEZ