The .NET Managed Resource File

   

With the .NET Framework, Microsoft has devised a solution for handling application resources that can be used within all the .NET languages. Visual C++ .NET is no exception. Rather than using the older resource scripts (.rc files), as was used with previous versions of Visual C++, the .NET Framework uses an XML-based file format with a file extension of .resx. The obvious advantage of using an XML-based format over the .rc file format is demonstrated by the number of tools available for XML files. XML is easy to parse, it is self-describing when used with a schema, and an abundance of third-party XML editors are available.

The process of creating a .NET resource file, however, is a little more difficult. Even though the Visual Studio .NET IDE does have XML editing capabilities, creating a managed resource file with this method is highly error prone and difficult. For simple projects with a few strings, it might be easier, but once you start embedding image files you will need another tool to get the job done. Rather than referencing an external image file from the resource file, the .NET Framework can read base-64 encoding. Base-64 encoding is a method that converts raw bits, as seen in an image file, into readable ASCII characters that can easily be included within an XML file.

Even though the Visual Studio .NET IDE does not have a tool for easily creating .resx files, a utility is supplied in one of the .NET Framework examples that ships with Visual Studio .NET. This utility is named ResEditor.exe and will prove to be quite valuable in creating managed resource files.


   
Top


Sams Teach Yourself Visual C++. NET in 24 Hours
Sams Teach Yourself Visual C++.NET in 24 Hours
ISBN: 0672323230
EAN: 2147483647
Year: 2002
Pages: 237

Similar book on Amazon

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