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 

Can I develop for both Vegas 4 and 5 in the same project?

 
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: Fri Aug 20, 2004 10:16 pm    Post subject: Can I develop for both Vegas 4 and 5 in the same project? Reply with quote

Yes you can. C# supports pre-processor statements that are interpreted at build time. You can use this to include the correct reference to the version of Vegas that you are using, or to include code that works differently based upon the Vegas version.

For your project, reference both Vegas 4 and 5.

In each source code file that uses Vegas, enter the following:
Code:
#if (Vegas5)
    using Sony.Vegas;
#elif (Vegas4)
    using SonicFoundry.Vegas;
#endif

These instructions tell the compiler which statements to include based upon a conditional compilation constant. You can also use this pattern to isolate code that uses different API elements in Vegas 4 and 5.

There are two ways to set the value of the conditional compilation constant. The best way is to add the symbol to your build configuration. Edit your project properties, click on Configuration Properties, then Build. Add ;Vegas5 to the Conditional Compilation Constants field to build for Vegas 5 or ;Vegas4 to build for Vegas 4.

Alternatively you can include the following line at the start of your source code.
Code:
#define Vegas5


I usually create a Vegas4_Release, Vegas4_Debug, Vegas5_Debug and Vegas5_Release build for my projects that will support both versions.
_________________
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