Windows apps
Collapse the table of content
Expand the table of content

module Statement [Automation]

This statement defines a group of functions, typically a set of DLL entry points.

[attributes]
module modulename {
   elementlist
};

attributes

The attributesuuid,version,helpstring,helpcontext, hidden, and dllnameare accepted before a module statement. For more information about the attributes that can be accepted before a module definition, see Attribute Descriptions. The dllnameattribute is required. If uuidis omitted, the module is not uniquely specified in the system.

modulename

The name of the module.

elementlist

List of constant definitions and function prototypes for each function in the DLL. Any number of function definitions can appear in the function list. A function in the function list has the following form:

   [attributes] returntype [calling convention] funcname(params);
   [attributes] const constanttype constname = constval;

Only the attributeshelpstring andhelpcontextare accepted for a const.

The following attributes are accepted on a function in a module: helpstring,helpcontext, string,entry, propget, propput, propputref, vararg. If varargis 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.

   [attributes] type paramname

The typecan 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, and optional.

If optionalis specified, it must only be specified on the right-most parameters, and the types of those parameters must be VARIANT.

The header file (.h) output for modules is a series of function prototypes. The modulekeyword and surrounding brackets are stripped from the header file output, but a comment (\\ module modulename) is inserted before the prototypes. The keyword extern is inserted before the declarations.

[uuid(D00BED00-CEDE-B1FF-F001-A100FF001ED),
   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);
};
Show:
© 2017 Microsoft