Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A Perl script to update your WTL installation

0.00/5 (No votes)
6 Sep 2000 1  
Notes on updating your WTL installation
  • Download source files - 1 Kb
  • Introduction

    When installing the Microsoft Platform SDK, you can choose to install WTL (Windows Template Library) source files, a collection of MFC-like classes that make GUI development a bit easier without the overhead imposed by "True-MFC". Unfortunately, the default installation does not enable immediate usage of WTL in Visual Studio (the complier can not find #included WTL headers even though WTL has been installed).

    Description

    This Perl script was written to automate the update of WTL. No input is required from the user and all arguments are ignored. We will define update as a process of making WTL available to projects in Visual Studio (i.e. #includes will successfuly locate WTL files).

    First, we suppose you have installed Microsoft Platform SDK with at least the following options:

    • Selected "Configuration Options/Integrate with MS Visual C++"
    • Selected "Configuration Options/Register Environment Variables"
    • Selected "Source Code/Windows Template Library"

    The Readme.txt file provided by Microsoft says it is is enough to copy header files from WTL source directory to one of include directories (directory that is searched when compiler looks for #includes). MS SDK installer registers path %MSSDK%/Include/Atl30 as the first include directory. Therefore the script first looks for the "MSSDK" environment value (path of the SDK installation). Then, files in %MSSDK%/Include/Atl30 (target) are updated with files from %MSSDK%/Src/WTL/Include (source). The update procedure evaluates time stamp difference between target file (if any) and source file. Each comparison may have one of those outcomes:

    • No target file: copy source file to target
    • Target and source files have the same time stamp: do not update target
    • Target is newer than source: issue warning and do not update target
    • Target is older than source: overwrite target with newer source file

    You can also use this script with further releases of MSSDK. After installing newer Platform SDK the script will ensure that %MSSDK%/Include/Atl30 contains current versions of WTL source files (all older files will be automatically replaced with new (installed) versions).

    Discussion

    Another way to update WTL would be to update a list of directories that Visual Studio scans when looking for #included files. This script tried to follow recommendation from WTL's readme.txt though.

    To do:

    • Update not only sources, but also application wizard file. That means copy awx files from WTL install directory to Visual Studio wizard directory. The only problem is how to locate Visual Studio installation path...

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here