This statement creates an alias for a type.
typedef [attributes] basetype aliasname;
The typedef keyword must also be used whenever a struct or enum is defined. The name recorded for the enum or struct is the typedef name, and not the tag for the enumeration. No attributes are required to make sure the alias appears in the type library.
Enumerations, structures, and unions must be defined with the typedef keyword. The attributes for a type defined with typedef are enclosed in brackets following the typedef keyword. If a simple alias typedef has no attributes, it is treated like a #define, and the aliasname does not appear in the library. Any attribute (public can be used if no others are desired) specified between the typedef keyword and the rest of a simple alias definition causes the alias to appear explicitly in the type library. The attributes typically include such items as a Help string and Help context.
typedef [public] long DWORD;
This example creates a type description for an alias type with the name DWORD.
typedef enum {
TYPE_FUNCTION = 0,
TYPE_PROPERTY = 1,
TYPE_CONSTANT = 2,
TYPE_PARAMETER = 3
} OBJTYPE;
The second example creates a type description for an enumeration named OBJTYPE, which has four enumerator values.