[attributes] module modulename {elementlist};
[attributes] returntype [calling convention] funcname(params);
[attributes] const constname = constval;
Only the helpstring and helpcontext attributes are accepted for a const.
The following attributes are accepted on a function in a module: helpstring, helpcontext, string, entry, propget, propput, propputref, vararg. If vararg is specified, the last parameter must be a safe array of VARIANT type.
The optional calling convention can be one of __pascal/_pascal/pascal, __cdecl/_cdecl/cdecl, or __stdcall/_stdcall/stdcall. The calling convention can include up to two leading underscores.
The parameter list is a comma-delimited list of:
[attributes] type paramname
The type can be any previously declared type or built-in type, a pointer to any type, or a pointer to a built-in type. Attributes on parameters are:
in, out, optional
If optional is used, the types of those parameters must be VARIANT or VARIANT *.
[uuid(. . .),
helpstring("This is not GDI.EXE"), helpcontext(190),
dllname("MATH.DLL")]
module somemodule{
[helpstring("Color for the frame")] unsigned long const COLOR_FRAME
= 0xH80000006;
[helpstring("Not a rectangle but a square"), entry(1)] pascal double square([in] double x);
};
The module statement defines a group of functions, typically a set of DLL entry points. The header file (.H) output for modules is a series of function prototypes. The module keyword and surrounding brackets are stripped from the header (.H) file output, but a comment (// module modulename) is inserted before the prototypes. The keyword extern is inserted before the declarations.
Generating a Type Library With MIDL, Contents of a Type Library, ODL File Syntax, TYPEFLAGS