/mktyplib203

midl /mktyplib203

Examples

midl /mktyplib203 myoldodl.odl

midl /mktyplib203 oldhabit.idl

 

Remarks

The /mktyplib203 switch forces the MIDL compiler to parse the input file in much the same manner as MKTYPLIB.EXE, version 2.03, would handle the file. In order to use this switch, the input file must follow the ODL syntax exactly   you cannot place any statements outside of the library block. Specifically, using the /mktyplib203 switch resolves the following discrepancies between MKTYPLIB and MIDL:

    MKTYPLIB typdef syntax is required for struct, union and enum data types.

    GUIDs in the header files are defined with a macro that can be conditionally compiled to generate either a GUID predefinition or an instantiated GUID.

    The base type BOOL is represented as a VARIANT_BOOL, which is defined as a short.

 

See Differences Between MIDL and MKTYPLIB1GUG5CL for a more detailed description of these differences.

There is only one discrepancy betweey MKTYPLIB.EXE and MIDL 3.0 that using the /mktyplib203 switch will not resolve and that is the scope of symbols in an enum declaration. In MKTYPLIB, these symbols have local scope; in MIDL 3.0 they have global scope. For example, the following code will generate a duplicate name error in MIDL:

typedef struct { . . . } a;

enum {  a=1, b=2, c=3};

 

See Also

General MIDL Command-line Syntax, Generating a Type Library With MIDL, Differences Between MIDL and MKTYPLIB