A COM server consists of the implementation of one or more object classes. An
object class is a type that describes the complete public calling interface ("signature")
of an object. It describes the functionality that you want to make available to the users
of the object. The COM server creates instances of the class, called objects,
at the request of clients.
Some of the advantages of implementing your Fortran code as a COM server include:
- A COM server is a reusable component, which allows multiple applications
to use the server. The classes specified by the server define a "contract" between
the server and its clients. The server can change the specific implementation of the
functionality without breaking the contract. That is, without requiring clients to
be changed or rebuilt.
- A COM server is programming-language independent. Multiple development tools
can be used to access the server's functionality, including Visual Basic, Visual C++,
and Visual Fortran.
- A COM server is self-describing. The server provides a type library that
describes the classes and interfaces. Many tools can take advantage of this information
and relieve the client programmer from needing to understand low-level invocation
details, such as calling conventions. This is a great improvement over
multi-language programming with DLLs, where the client programmer has to understand
the details of data types and calling conventions.
- A COM server is self-registering. The clients do not need to worry about
where the server is located on their system, as COM finds this information in
the system registry.
- A COM server can be implemented as an in-process server. Like a DLL, it
is loaded into the client's process. A COM server can also be implemented as a
separate application and can even reside on a separate machine.
Visual Fortran provides the Fortran COM Server Wizard. The wizard generates the
Fortran code necessary to implement a COM server, and allows you to concentrate on
the code that is specific to the functionality that your server provides to its
clients.
As explained in Overview of COM and Automation Objects,
COM supports two types of servers: COM servers and Automation servers. The
Fortran COM Server Wizard can only create a COM server or a server that
supports dual interfaces. The wizard cannot create an Automation-only interface.
For more information about creating COM servers using Visual Fortran, see
What You Need to Do and What the COM Server Wizard Will Do.