To invoke MkTypLib, enter the following command line:
MkTypLib [options] ODLfile
MkTypLib creates a type library (.tlb) file based on the object description script in the file specified by ODLfile. It can optionally produce a header (.h) file, which is a stripped version of the input file. This file is included in C or C++ programs that want to access the types defined in the input file. In the header file, MkTypLib inserts DEFINE_GUID macros for each element defined in the type library (such as interface, dispinterface, and so on).
There can be a series of options, each prefixed with a hyphen (-) or a slash (/), as follows:
Option | Description |
---|---|
/? or /help | Displays command line Help. In this case, ODLfile does not need to be specified. |
/align:alignment | Sets the default alignment for types in the library. An alignment value of 1 indicates natural alignment; n indicates alignment on byte n. |
/cpp_cmd cpppath | Specifies cpppath as the command to run the C preprocessor. By default, MkTypLib invokes CL. |
/cpp_opt "options" | Specifies options for the C preprocessor. The default is /C /E /D__MkTypLib__. |
/D define[=value] | Defines the name define for the C preprocessor. The value is its optional value. No space is allowed between the equal sign (=) and the value. |
/h filename | Specifies filename as the name for a stripped version of the input file. This file can be used as a C or C++ header file. |
/I includedir | Specifies includedir as the directory where include files are located for the C preprocessor. |
/nocpp | Suppresses invocation of the C preprocessor. |
/nologo | Disables the display of the copyright banner. |
/o outputfile | Redirects output (for example, error messages) to the specified outputfile. |
/tlb filename | Specifies filename as the name of the output .tlb file. If not specified, it will be the same name as the ODLfile, with the extension .tlb. |
/win16 /win32 /mac /mips /alpha /ppc /ppc32 |
Specifies the output type library to be produced. The default is the current operating system. |
/w0 | Disables warnings. |
Although MkTypLib offers minimal error reporting, error messages include accurate line number and column number information that can be used with text editors to locate the source of errors.
MkTypLib spawns the C preprocessor. The symbol __MKTYPLIB__ is predefined for the preprocessor.