// example DLL OBJECT (c) Stewart N. Johnston, Sept. 9, 1993


  This zip file contains an example of a DLL class object.
  This example is in conjunction to a question asked on
  the BORLAND go BCCWIN forum of Compuserve, posted Sept. 1993.

  This program is not an example of programming excellence it
  is just a creative solution to the following problem.

  Problem:

	To load and create an instance of a C++ class located in a DLL.

	Constraints

	-The program will not know the name of the DLL until run time.
	-It should be able to create multiple instances of
	 the DLL class.  
	-Should be able to load different DLL,s containing
	 different classes, but all having the same interface.

  Content
  dllclass.zip CONTAINS:
		app.prj
		  dllobje.h
		  dllobje.cpp
		  app.def
		  app.cpp

		dllclass.prj
		  b.cpp
		  b.h
		  c.cpp
		  c.h
		  dlllib.cpp
		  dlllib.def


  Compile and link (app.prj) and (dllclass.prj) in directory c:\dll,
  then with the debugger step through app.prj  .  If you find any
  problems with this example please give me a shout
  (Stewart Johnston 71342,153).

  Possible Problems

   - In dlllib.cpp where the instance of the DLL class is created,
     { bz = new B(message,wParam,lParam);    }
     from what data segment does the new operator create the instance
     of the class B?  Will it exist in the applications data segment
     or the DLL's data segment?

   - If it allocates the memory from the DLL data segment should I
     create the DLL with a large heap size or should I overload the
     new operator so it will allocate from the global heap?

   - And in what segment will the VMT reside? (Virtual Member function Table)

     I feel that the VMT deserves some attention, because  B class
     is a derived class with virtual member functions.  Because
     the VMT is usually accessed with the es register I fear
     that when switching in and out of the DLL the es register
     will not be preserved and the program may crash.
     Should I worry about the above?

   - Is there any literature on how the BORLAND compiler and linker
     creates the VMT and its format?






