www.jetdv.com Forum Index Edward Troxel
Vegas Scripting and Newsletters
Home of Excalibur and Montage Magic
 
 FAQ   Search   Memberlist   Usergroups   Register   Profile 
 Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Class already exists" error with C# application

 
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ
View previous topic :: View next topic  
Author Message
DanPenn



Joined: 24 Feb 2006
Posts: 7

PostPosted: Mon Mar 13, 2006 8:14 am    Post subject: "Class already exists" error with C# application Reply with quote

I'm having difficulty figuring out how to prevent this rather annoying error message that occurs when trying to run my application (C#) more than once in a row. The first time I run it, it works like a champ. From other posts I gather that the first time I run the application it isn't getting unloaded/dereferenced fully.

The full error is:
Class already exists
at System.Windows.Forms.WindowClass.RegisterClass()
at System.Windows.Forms.WindowClass.Create(String className, Int32 classStyle)
...blah, blah, blah


Closing my VEG file and re-opening it seems to clear things up but this isn't an acceptable workaround.

When running under the debugger I see the following spew in my debug output so it appears to be terminating:
The program '[292] vegas60.exe: Script Domain' has exited with code 0 (0x0).

I'm using Vegas 6.0 and C# (.NET Framework 1.1)
Back to top
View user's profile Send private message Visit poster's website
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Mon Mar 13, 2006 3:03 pm    Post subject: Reply with quote

That's a known problem with Vegas 6. There is, fortunately, a workaround. When exiting, the script, just run this line of code at the very end:

Code:
Application.Exit();



I actually use this code (just in case the DLL is being run in Vegas 5 in which case that line would exit VEGAS)

Code:
if (VegasInfo.Vegas.Version.Substring(0,9) != "Version 5")
    Application.Exit();
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group