============
MultiTServer
============

Also SimpleChat (client).

A demonstration of supported multithreading in VB6.


Background
----------

In VB6 Microsoft produced a mechanism to handle multithreading
as part of the Apartment-Threading Model.  Thread pooling and
other capabilities exist, but this example is based on the
Thread-Per-Object threading option.

It is pretty much straight from the book, closely following
the instructions given in the VB6 documentation for a demo
multithreading program.


Unregistering
-------------

I have included UnReg.vbs, a WSH script for unregistering the
compiled ActiveX EXE produced by this project.  I don't like
leaving component entries in the registry for junk and
experiments any more than you probably do.

Usage:  Simply drag the EXE onto the script and drop it, or
        you can run the script from a command prompt.  See
        comments in the script for details.

THIS WILL BE CLUMSY ON VISTA OR LATER!  You must either run
the script from an elevated command prompt, or use another
workaround:

Create a shortcut to the compiled EXE.  Change the Properties
of this shortcut so that Target is the path to the EXE with
a switch after it as:

    /unregserver

The result for Target will look something like:

    D:\Work Area\MultiTServer\MultiServer.exe /unregserver

Run this shortcut *elevated* to unregister MultiTServer.exe.

NOTE:  You should unregister each time before compiling the
       Project again because we're using "No compatibility"
       which means we get new classIDs each compile.  If you
       overwrite the old EXE you cannot easily unregister it!
       The result is a large amount of trash in the registry.


The Demo
--------

Run the server and start it (click Listen).

Then run one or more clients, start them (Connect), and chat
away.

You can start Task Manager and enable the Threads column in
the Processes tab.  This can be used to monitor the
application's thread count as you add new threads.

Just close the programs (close the UI form of the server) to
close it all down.
