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 

Why can't I use the ScriptSetting variable in a DLL?

 
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Custom DLL FAQ
View previous topic :: View next topic  
Author Message
Randall Campbell



Joined: 20 Aug 2004
Posts: 127
Location: Durham, NC

PostPosted: Thu Aug 26, 2004 6:05 pm    Post subject: Why can't I use the ScriptSetting variable in a DLL? Reply with quote

If you try to pass the ScriptSetting variable from JScript into a custom DLL, you will get a cast exception when you try to cast to an XmlDocument even though ScriptSetting is an XmlDocument. This is apparently a bug in .Net.

The workaround is to create your own XmlDocument from the script config file. Here is a code snippet for Vegas 5:
Code:
XmlDocument scriptSettings = new XmlDocument();
XmlTextReader reader = new XmlTextReader(ScriptFile + ".config");
scriptSettings.Load(reader);
reader.Close();

ScriptFile is the full path to the script file.

A more complete sample, that will read both Vegas 4 and 5 setting files, is available in the "Config.cs" file which is part of the VegasHello sample.
_________________
Randall Campbell
www.peachrock.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Custom DLL 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