Using Microsoft Visual Basic to Create a
Graphical Front-End for a CSIM19 Model
This document describes how to use Microsoft Visual Basic to quickly and easily create
a graphical front-end for a CSIM19 simulation written in C. The example used in this document
is a simple service center phone bank. The source for this example is included with this
document. You will not be able to compile the source yourself unless you own the CSIM19
libraries. This document assumes that readers are reasonably familiar with CSIM19 and
basically proficient in Microsoft Visual Basic and Microsoft Visual C++. Obviously the methods
described here are also applicable in other development environments, as long as users know
their preferred development tools well enough.
The first step in this process is to create your CSIM model as you would normally. In our
example, the model was first written and compiled as a standard Win32 console application
using Microsoft Visual C++ 6. The original console program is included in this tutorial package
and is called phone.exe. In this stage it is easy to find and fix all the bugs in the model itself
without worrying about problems anywhere else. It is important to verify that the model gives
the correct output at this stage, so that it will be easier to catch any bugs in the GUI later.
At this point we can design the Visual Basic interface. For our simple example, the
program only really needs one, single form. In the source project there are two forms, but one
is simply a home-made help screen. All the user needs to do is give the model some numbers
and then get some other numbers back. For this, the Visual Basic form just needs a text field
for each simulation parameter, and a space with some label objects to show the results. A
simple mschart object has also been included in the example to show the results of several
trials when the user enters a range for the number of operators to try.
Now that the two parts of the application are ready, (the sim