CSCE 790A: Problem Set 4

Due: Wednesday, 2 May 2001

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:

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:

  1. Start Visual C++ 6.0
  2. Go under File->New, start a new MFC App Wizard (exe) project called WordClient (or whatever), choose Dialog-based, then click "Finished".
  3. Draw your GUI (you do more later). TIP: Do a ctrl-doubleclick on any "Edit Box" in order to tie it to a member variable.
  4. Change 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.
  5. Hit ctrl-W (starts the MFC Class Wizard), on the Automation tab, do an "Add Class->From Type Library" and choose the "msword9.olb" file. The file should be under "Program Files/Microsoft Office/Office/msword9.olb". Select the classes: then hit "OK". The files "msword9.h" and "msword9.cpp" should appear in your project's file list.
  6. Add the line #include "msword9.h" to the top of WordClient.cpp.
  7. Add code to manipulate the Word object. You can start by copying my WordClient.cpp file.
  8. Run it. Click on OK. Wait. You should see word start up and write something.

Jose M. Vidal
Last modified: Tue Apr 17 10:28:06 EDT 2001