# $ K + Introduction to MDT
The Microsoft Minidriver Development Tool (Microsoft MDT) is a Windows® 2000,  Windows® XP, and  Windows® Server 2003  software tool designed for easy development of minidrivers that enable the Microsoft Universal Printer Driver (Unidrv) to support new non-Postscript® printers.
·      Minidriver New Wizard
Property sheet-based wizards for creating new file, project and converting projects.
·      Minidriver Conversion Wizard 
Automatically converts existing minidriver files to versions that can be used with Windows XP Unidrv.
·      Generic Printer Description (GPD) Editor 
Syntax-checking text editor for modifying the GPD files that make up Unidrv minidrivers.
·      Unidrv Font Metrics (UFM) Editor 
Property sheet-based editor for modifying Unidrv Font Metrics files.
·      Glyph Translation Table (GTT) Editor 
   Property sheet-based editor for modifying Glyph Translation Table files.
·      String Resource Editor 
Dialog box for modifying text strings contained in a minidriver's resource file (.rc file).
·      Minidriver Workspace
Window-based editing workspace for a Unidrv minidriver, providing access to the minidriver's GPD, UFM, GTT, and resource files.
·      INF Wizard 
Automatically creates INF files required for installing Unidrv minidrivers.
For additional information about the Microsoft Universal Printer Driver (Unidrv), see the Windows XP DDK.

# $ K + Minidriver Workspace
A minidriver workspace contains all of the files associated with minidrivers that use a single resource DLL. Workspace information is stored in an .mdw file. A workspace maintains the following information: 
·	The list of files used to create a minidriver resource DLL, along with their resource identifiers. These files include the RC file and all GTT and UFM files.
·	The GPD files that use the resource DLL.
Within a minidriver workspace, you can edit GPD, UFM, and GTT files. You can also edit string resources defined by the RC file.
Each printer model must be described by a separate GPD file. However, it is common to use a single resource DLL for several printer models, with the various models sharing a set of resources ( such as UFM and GTT files, and string tables). Thus several GPD files, each describing a different printer model, are typically associated with a single resource DLL.
Each workspace should include all of the GPD files associated with a resource DLL, so the workspace can access all identifiers for fonts and other resources. GPD files can be added to and deleted from a workspace.
To create a minidriver workspace, select New from the File menu (or press CTRL+N) to start the Minidriver New Wizard

When the wizard completes a creating new project or conversion, MDT displays a minidriver workspace window so you can edit minidriver files.

# $ K + Minidriver Conversion Wizard
The Minidriver Conversion Wizard converts binary minidrivers, used with previous versions of Windows and Windows NT, into text-based minidrivers for Windows XP. When you use the Wizard, it creates a Windows XP minidriver by converting the following files:
Input files	File Contents	Output Files	
	
Windows GPC files	Printer capability descriptions	Windows XP GPD files	
Windows PFM files	Font descriptions	Windows XP UFM files	
Windows CTT files	Glyph translations	Windows XP GTT files	

Additionally, the wizard generates resource files (.rc files) with the correct file names and resource identifiers.
The wizard creates a minidriver workspace, which allows you to easily edit all of these files. You can also edit string resources.
If the wizard detects errors within a .gpd file, it adds error messages to the file as comments.
The wizard creates localized minidrivers, using built-in code page information, without requiring the use of a system set up for the locale in which the minidriver is to be run.
For more information about minidriver creation, see Creating a Minidriver.
To run the Minidriver Conversion Wizard, select New from the File menu (or press CTRL+N) and go to the converters tab and select the project button, Then follow the wizard’s instruction.

# $ K + INF Wizard
The INF Wizard automatically creates an INF file for your minidriver. INF files are required for installing Unidrv minidrivers, and are described in the Windows XP DDK.
Before the INF Wizard creates an INF file, it allows you to customize the file contents. The Wizard places the new file in a window within the minidriver workspace, so you can view the file and make additional modifications, if necessary.
The INF Wizard is available whenever a minidriver workspace window has focus.
To create an INF file:
Select Generate INF in the File menu (or press F9) to run the INF Wizard, then follow the wizard's instructions. This creates an INF file window.
To check an INF file's contents:
While an INF file window has focus, select Check INF in the File menu (or press F8). This verifies that the files listed in the INF file exist.
To modify an INF file:
While an INF file window has focus, select Change INF in the File menu (or press F9) to rerun the INF Wizard, then follow the wizard's instructions. This modifies the contents of the INF file window.
To save an INF file:
Select Save or Save As in the File menu, or close the INF file window and select Yes in the resulting pop-up window.

# $ K + Glyph Translation Table (GTT) Editor
A glyph translation table specifies the selection strings required to print characters associated with the code points within code pages. The GTT editor is a property sheet-based dialog box that allows you to modify selection strings, add code points, and change the code pages used.
When you open a .gtt file, MDT creates a GTT Editor Window. You can open a .gtt file by the following methods:
•	In the minidriver workspace window, double-click on a GTT name under the workspace's "GTTs" tree node.
•	In the Windows Explorer, double-click on the file's name.

# $ K + Unidrv Font Metrics (UFM) Editor
Each of a printer's device-resident fonts must be described by a Unidrv font metrics file (.ufm file). The UFM editor is a property sheet-based dialog box that allows you to modify a font description. The editor lets you view and modify the C-language structures used for creating .ufm files.
All structures displayed by the dialog box are described in the Windows XP DDK. You should refer to the DDK for information about each structure's members.
When you open a .ufm file, MDT creates a UFM editor window. You can open a .ufm file by the following methods:
•	In the minidriver workspace window, double-click on the name of a font under the workspace's "UFMs" tree node.
•	In the Windows Explorer, double-click on the file's name.
•	In the GPD Editor Window, double-click on the associated font's resource identifier, if the identifier is represented numerically in the .gpd file.

# $ K + Generic Printer Description (GPD) Editor
The characteristics and capabilities of each printer model supported by Unidrv must be specified by a generic printer description, contained in one or more .gpd files. The GPD editor is a text editor that allows you to view, modify, and check the syntax of a .gpd file.
When you open a .gpd file, MDT creates a GPD Editor Window. You can open a .gpd file by the following methods:
•	In the minidriver workspace window, double-click on a GPD name under the workspace's "GPDs" tree node. This creates a GPD Editor Window.
•	In the Windows Explorer, double-click on the file's name.

# $ K + String Resource Editor
A single resource file (.rc file) is associated with each minidriver workspace. The string resource editor allows you to add, remove, or modify string resources contained in the .rc file.
To edit a minidriver's string resources, you must open a String Resource Editor Window. Two methods are available:
•	Double-click on "Strings" under the "Resources" tree node in the minidriver workspace window.
•	Double-click on a string's resource identifier in the a GPD Editor Window, if the identifier is represented numerically in the .gpd file.

# $ K + String Resource Editor Window
A String Resource Editor window displays the string resources contained in a single .rc file. One .rc file is associated with each minidriver workspace. For existing string resources, you can modify resource identifier numbers and associated text strings, or you can delete the resource. You can also add new string resources.
To edit a string resource:
Double-click on the resource's identifier or text string, then use the keyboard to modify or replace the existing identifier or text string.
To add a string resource:
Use the Up Arrow and Down Arrow keys to highlight an existing resource, then press Insert and type in new values. The new resource is added above the resource you highlighted.
To delete a string resource:
Use the Up Arrow and Down Arrow keys to highlight an existing resource, then press Delete.

# $ K + Master Units
Master units are the least common multiple of the various resolutions your printer supports. Typically, they represent the highest resolution provided. For more information about master units, see the Windows XP DDK.

# $ K + Font Units
A font unit is the smallest addressable unit within a font's em square. Font units are used to specify all font measurements except resolution (which defines the master units), italic angles (specified in 10ths of a degree) and character weights (specified without units).
If a font is scalable, font units might have a greater resolution than master units. If a font is not scalable, font units are identical to master units.

# $ K + About Box
The About dialog box describes the program version, and gives you some information about the your system.
•	The version of MDT you are running
•	Memory and disk space currently available on your system
•	Code pages currently available on your system
•	All code pages known by your system
If a code page is listed by number but does not include a description, a definition of the code page's purpose was not available when the Minidriver Development Tool was released.

# $ K + Tip of the Day
The Tip of the Day dialog box presents a series of useful tips for using the Minidriver Development Tool and working with minidriver source files. The tips are stored in a file named tips.txt, in the directory in which the program files reside. Each tip is a line in the file. If others in your organization will be using this program, you might want to add your own tips to the file.

# $ K + Creating a Minidriver
A Unidrv minidriver consists, minimally, of one or more .gpd files and a resource DLL. The resource DLL defines all text, icon, bitmap, and font resources required by the minidriver. Additionally, .ufm and .gtt files might be needed to describe the characteristics of device-resident fonts.
There are several ways for the MDT to create a Unidrv minidriver for Windows XP
1.	You can use the Minidriver New Wizard for creating a new project from the scratch with your selected template (.gpd file)
2.	If you have an existing Win16 or Win32 minidriver, created for earlier versions of Windows or Windows NT, you can convert it by using the Minidriver Conversion Wizard.
3.	If you just want use existing resource and gpd files, you can base the minidriver on one provided with the Windows XP DDK. You can find sample .gpd files under the /gpd subdirectory of the Windows XP DDK. 
For each sample .gpd file, an associated .rc file can be found in the DDK's /gpdres subdirectory. Copy and rename the .gpd and .rc files you intend to use, then modify them as needed.
If the new printer supports device fonts, .ufm and .gtt files must be provided. You might be able to use .ufm and .gtt files supplied with the DDK (modified if necessary).
An additional step to creating a minidriver involves building a resource DLL.
After a minidriver has been created, it can be installed using an INF file. You can use the INF Wizard to create an INF file automatically.

# $ K + Building a Resource DLL
Build a resource DLL is different by what you have used for creating a project. If you used Minidriver New Wizard, the target directory would contain an .rc file that lists the .gtt and .ufm files needed to build the resource DLL, and source, makefile, .def for build. In this case, you just save the project first and then go to DDK’s free or checked build environment (The .rc file is not created until you save the workspace file in the workspace.)
However, if you used Minidriver Conversion Wizard, the target directory would contain only an .rc file that lists the .gtt and .ufm files needed to build the resource DLL. You can find templates for the other files you will need in the DDK samples. To build a resource DLL in the target directory, you must add the following files to that directory:
•	A sources file specifying the files to be built, and the target file's name, path, and type. You can copy this file from one of the DDK's minidriver subdirectories and edit it as needed. (If you are basing your sources file on one in the DDK, you should place the target directory be under the \gpdres subdirectory of the DDK's printer sources path.)
•	An unedited copy of makefile. A copy of this file is located in each of the DDK's minidriver subdirectories.
•	A module definition (.def) file, containing the resource DLL's name in the file's LIBRARY statement.
After these files have been placed in the target directory, you can start the DDK's free or checked build environment and type build. (For more information about build environments and the build utility, see Windows XP DDK documentation.)
Within the minidriver's .gpd file is a *ResourceDLL entry. This entry must identify the name of the minidriver's resource DLL. For more information about the *ResourceDLL entry, see Windows XP DDK documentation.
If you are supporting several printer models that share common resources, it is best to create a single resource DLL that can be used by all of the models' minidrivers. This technique saves both disk space and the amount of time required to localize minidrivers.
Microsoft provides stdnames.gpd with the Windows XP DDK. This file identifies string resources for many standard text strings used with printer minidrivers. Whenever possible, use the strings identified by stdnames.gpd instead of replicating them in your resource DLL.

# $ K + Minidriver New Wizard
The Minidriver New Wizard has three tabs entitled New File, Project, and Converter. You can use each wizard for creating a file, creating a project, and the conversion of a project, pfm or ctt. 

File Tab
The wizard can create new file (.GPD, .UFM, and .GTT) from the scratch in this page. 

Project Tab
The wizard can create a new project from the scratch based of template. 
The wizard can create the minidriver workspace window, which allows you easily edit all of gpd, ufm and gtt files.
Additionally, the wizard generates build environment files such as .rc, makefile, source,.def files. If you want to use these resources for adding more models, you just add the file names into the source file after creating or copying .gpd files into project directory. 
The wizard provides an option to add a new template into the project template list. This added template file (.gpd) copied to under \\template directory of minidev.exe root. If you want to change the contents of template, you can modify this file directly. 
The ufm and gtt files that need to be added into the wizard through Project creation should not have the read-only active.
The wizard use pcl.txt file, which will be created at minidev.exe root after first project creation, when they create strings in the .rc file. You can edit or add new strings into pcl.txt for your own template (.gpd) file.

Converter Tab
The wizard provides converters for project (Minidriver Conversion Wizard), PFM, and CTT.
The PFM converter wizard allows conversion from PFM to UFM through a specific GTT file and code page, but this wizard does not support DBCS code page.
The CTT converter wizard provides conversion from CTT to GTT through selected code page.