This page illustrates one of the configurations in which the language engine can
Generating a COM module for an existing 'C' language function library
This is a fairly common problem, where one set of programmers with particular
domain knowledge have written a function library in C or C++, and need to
integrate it with other systems via COM. They will not necessarily have the
technical skills to write COM wrappers, nor any inclination to acquire same.
The task here is to build a COM object library, so an appropriate pre-rolled COM
library template is selected. This manages all implementation details, such as
creating a DevStudio project and all its source files, enabling the selected
thread and deployment models, and supplying all the texts required for both
in-library documentation and on-line help.
Read existing code
source code is read into the object model using 'C' language parsers. All
function signatures are parsed, and all available comments, including
structured comments (e.g. '@param') are read in. In addition assertions can be
read in, to establish any constraints assumed by the writer of the library
Interactive tools are used by the developer to enrich the object model. In
particular, constraints on inputs and relations between inputs should be
indicated at this point, such as the linkage between an array pointer and an
The language engine generates all the C++, IDL and RGS code and optionally
builds the project. The module is now complete and is ready for testing from
other modules and IDEs.
The language engine also builds a test harness. This might be written in Visual
Basic, with a custom form containing entry fields for all the function's
parameters. Or it could be an Excel spreadsheet, with input & output fields
laid out in a user-friendly way, and an add-in function written in VBA.
Test and redesign
If further changes to the interface are required, return to Step 2 and make
them, then regenerate the code.
In the following pages, we discuss some of the applications for which the engine
has been used:
All trademarks are the properties of their respective owners