Using Third-party Programming Languages


So far, you have seen development in Visual Studio .NET using programming languages supported by Microsoft with toolset. As discussed earlier in the .NET Framework section (see Chapters 2 and 3), .NET allows third parties to develop support for new and existing programming languages. This development isn't limited at the framework level, but the tool vendors can provide integrated support for development of applications using third-party languages right within Visual Studio .NET. Now take a quick look at such integration.

One such integration is from ActiveState, which provides a plug-in for integrated development of .NET components and applications in the programming language Perl, using a plug-in called Visual Perl. To get started, you need to first buy and download the plug-in from ActiveState at http://www.activestate.com/Products/Visual_Perl/. Visual Perl requires ActiveState Perl distribution ActivePerl and Perl Dev Kit to be installed first. Note that two separate installers are available for Visual Perl: Visual Studio .NET 2002 and Visual Studio .NET 2003. After the components are installed, if you launch Visual Studio .NET, you will notice that an icon has been added to the Installed Components list of Visual Studio, which shows that the Visual Perl plug-in has been installed and configured. If you missed the startup image, you can confirm this by selecting Help, About Microsoft Development Environment, which should display information about the added plug-in as well, shown in Figure 5.33.

Figure 5.33. Visual Studio .NET with Visual Perl plug-in.

After the environment is loaded, you can use the familiar New Project Wizard to create a Perl application for the .NET Framework. It is important to note that Visual Perl is focused on creating Perl-based applications that are compiled to run on the .NET Framework Common Language Runtime instead of the normal execution mode of Perl, which is to run as interpreted scripting language. Visual Perl supports Control Library, Managed DLL Library, Managed Executable, a Tray Application Wizard, and Windows Service Project Wizard (Figure 5.34). Select Managed Executable and create a new project.

Figure 5.34. Visual Perl Projects wizards.

A basic Hello World application is already created for you; you can choose to compile it to get started or add on logic to it using the Perl programming language. Here is what the basic program should look like:

 
 # PerlProject1 -- # # Generated by Visual Perl from a template ... # # # ... use strict; use namespace "System"; use PerlNET qw(AUTOCALL); Console->WriteLine("Hello, World.\n"); 

Running the program (in this case "perlproject1.exe ") should produce the Hello World output.



Microsoft.Net Kick Start
Microsoft .NET Kick Start
ISBN: 0672325748
EAN: 2147483647
Year: 2003
Pages: 195
Authors: Hitesh Seth

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net