ScanTool
Overview
ScanTool is a desktop application that scans and analyzes files and directory trees and generates useful reports from the analysis of the files. For example, one report shows the structure and size of VB projects in the directory tree. Another report shows information about COM components referenced by the VB code. The program has an object-oriented design, with a different class handling each type of report.
The ScanTool sample consists of two VB6 projects:
- ScanToolLib.vbp builds into a library, ScanToolLib.dll
- ScanToolUI.vbp builds into an executable application, ScanToolUI.exe, which references the ScanToolLib.dll library
The source codes for these projects are located in the [INSTALLDIR]\samples\source\ScanTool subdirectory of gmStudio.
Two sample Migration Projects are included in the ScanTool example, depending on target language (C# or VB.NET) as shown below:
Project[.gmproj] | Description |
DemoScanTool_csh | ScanToolUI and ScanToolLib migrated to C#.NET, all COM externals migrated to .NET |
DemoScanTool_vbn | ScanToolUI and ScanToolLib migrated to VB.NET, all COM externals migrated to .NET |
The ScanTool source is comprised of about 2200 lines of code (LOC).Â
ScanToolLib.vbp clsCOMReporter.cls clsDirList.cls clsScanControl.cls clsVBPBinReporter.cls clsVBPCntReporter.cls clsVBPModReporter.cls clsVBPRefReporter.cls clsVBPSrcReporter.cls ScanToolLib.bas
The UI source isÂ
ScanToolUI.vbp ScanTool.frm ScanToolHelp.htm ScanToolUI.bas
A pivot table of data produced by the Source Structure report for ScanTool is displayed below.
The DLL communicates its status to the EXE through COM Events. ScanTool also uses several external COM libraries and ActiveX controls: MSXML, Scripting, Common Dialog, and TypeLibInfo, and it also calls Win32 APIs, like ShellExecuteForExplore.
COM Dependencies
ScanTool depends on the following external COM components that must be installed on your workstation to perform the migration successfully:
File | Description |
ComDlg32.OCX | Microsoft Common Dialog Control |
msxml6.dll | Microsoft XML, v6.0 |
scrrun.dll | Microsoft Scripting Runtime |
TLBINF32.DLL | TypeLib Information |
Deployment
The ScanTool migrations all work on the ScanTool source and save outputs in the DemoScanTool workspace. The demos are available in both VB.NET (vbn) and C# (csh)
All the ScanTool migration projects have the following deployment settings:
ProjectFolder = [INSTALLDIR]\samples\workspace\DemoScanTool DeployFolder = %ProjFolder%\deploy
Log files showing all migration steps are created in the workspace\log folders.
[INSTALLDIR]\samples\workspace\DemoScanTool\log
The .NET project files are deployed to the following folders:
[INSTALLDIR]\samples\workspace\DemoScanTool\deploy\[project]_mgd_[lang]. where: [project] is the name of the migration unit associated with each migration task in the migration project. [lang] is "csh" or "vbn" depending on the task settings.