For this PS you will implement a document-generator with a GUI frontend.
Document generators are a common business application. They usually provide a simple form that asks the user a number of questions. The replies to these questions are then used to generate a "fancy" document. Common examples include the generation of goverment forms, invoices, inventory lists, etc.
Your implementation will consist of two parts: a backend report generator which exposes a DCOM interface and generated Microsoft Word documents, and a client which displays a GUI to the user and communicates with the backend (Its a three-tier architecture if you consider Word as the its own tier).
The interface will implement the following functions:
setName(string name)
- sets the name of the person.setAge(int age)
- sets the age of the person.setDepartment(string dept)
- sets the department the person works for. saveFile()
- saves the current information into a .doc file.The file should look something like (with the values replaced to match whatever the user input):
Name: ButterCup Age: 4 Department: Law Enforcement.
Hand in: You will need to write a README file with instructions for how to run your program. Your client and server can run on the same machine.
If you want to generate a C++ Word automation client, the easy way, follow these steps:
WordClient.cpp::InitInstance()
so that
it starts with AfxOleInit()
and ends, before the
return, with AfxOleTerm()
. Compile and run this
application. It will not do much._Application
Documents
_Document
Selection
_Font
Find
#include "msword9.h"
to the top of
WordClient.cpp
.