home *** CD-ROM | disk | FTP | other *** search
/ PC Press 1997 July / Sezamfile97_2.iso / windows / program / activex / axtsamp.exe / TSBRANCH.EXE / FRESERVE / FRESERVE.TXT < prev    next >
Text File  |  1997-01-05  |  5KB  |  94 lines

  1.  
  2. FRESERVE - Free-threaded COM objects in an in-process server
  3.  
  4.  
  5. SUMMARY
  6. =======
  7.  
  8. The FRESERVE sample shows how to construct a COM object in a free-threaded
  9. in-process server. This sample departs from the sport utility vehicle
  10. metaphor and associated interfaces used in other samples of this series.
  11. FRESERVE introduces a new custom interface, IBall, and a new COM object,
  12. COBall. COBall implements the IBall interface. Both COBall and its
  13. in-process server are coded to support COM free threading in anticipation
  14. of their use by the free-threaded client, FRECLIEN, in the next lesson.
  15.  
  16. The CThreaded facility in APPUTIL is used to achieve thread safety as it
  17. was in the previous APTSERVE sample. COBall objects are derived from the
  18. CThreaded class and so inherit its OwnThis and UnOwnThis methods. These
  19. methods enforce mutually exclusive access to the FRESERVE server and to
  20. free-threaded COBall objects managed by the server.
  21.  
  22. FRESERVE works with the FRECLIEN code sample to illustrate FRESERVE's COM
  23. server facilities in a free-threaded server and the subsequent manipulation
  24. of its components by a free-threaded client.
  25.  
  26. For functional descriptions and a tutorial code tour of FRESERVE, see the
  27. Code Tour section in FRESERVE.HTM. For details on setting up the
  28. programmatic usage of FRESERVE, see the Usage section in FRESERVE.HTM. To
  29. read FRESERVE.HTM, run TUTORIAL.EXE in the main tutorial directory and
  30. click the FRESERVE lesson in the table of lessons. You can also achieve
  31. the same thing by clicking the FRESERVE.HTM file after locating the main
  32. tutorial directory in the Windows Explorer. See also FRECLIEN.HTM in the
  33. main tutorial directory for more details on the FRECLIEN client
  34. application and how it works with FRESERVE.DLL. You must build
  35. FRESERVE.DLL before building or running FRECLIEN.
  36.  
  37. FRESERVE's makefile automatically registers FRESERVE's DllBall component
  38. in the registry. This component must be registered before FRESERVE is
  39. available to outside COM clients as a server for that component. This
  40. self-registration is done using the REGISTER.EXE utility built in the
  41. previous REGISTER lesson. To build or run FRESERVE, you should build the
  42. REGISTER code sample first.
  43.  
  44. For details on setting up your system to build and test the code samples
  45. in this ActiveX Tutorial series, see TUTORIAL.HTM. The supplied MAKEFILE
  46. is Microsoft NMAKE-compatible. To create a debug build, issue the NMAKE
  47. command in the Command Prompt window.
  48.  
  49. Usage
  50. -----
  51.  
  52. FRESERVE is a DLL that is intended primarily as a free-threaded COM
  53. server. Although it can be implicitly loaded by linking to its associated
  54. .LIB file, it is normally used after an explicit LoadLibrary call, usually
  55. from within COM's CoGetClassObject function. FRESERVE is a
  56. self-registering in-process server. The makefile that builds this sample
  57. automatically registers this server in the registry. You can manually
  58. initiate its self registration by issuing the following command at the
  59. command prompt:
  60.  
  61.   nmake register
  62.  
  63. This registration process requires a prior build of the REGISTER sample
  64. in this series.
  65.  
  66. To use FRESERVE, a client program does not need to include FRESERVE.H or
  67. link to FRESERVE.LIB. A COM client of FRESERVE obtains access solely
  68. through its component's CLSID and COM services. For FRESERVE, that CLSID
  69. is CLSID_DllBall (defined in file BALLGUID.H in the INC sibling
  70. directory). The FRECLIEN code sample shows how the client obtains this
  71. access.
  72.  
  73.  
  74. FILES
  75. =====
  76.  
  77. Files         Description
  78.  
  79. FRESERVE.TXT  This file.
  80. MAKEFILE      The generic makefile for building the FRESERVE.DLL
  81.               code sample of this lesson.
  82. FRESERVE.H    The include file for declaring as imported or defining as
  83.               exported the service functions in FRESERVE.DLL.
  84. FRESERVE.CPP  The main implementation file for FRESERVE.DLL. Has DllMain
  85.               and the COM server functions (for example, DllGetClassObject).
  86. FRESERVE.RC   The DLL resource definition file for the executable.
  87. FRESERVE.ICO  The icon resource for the executable.
  88. SERVER.H      The include file for the server control C++ object.
  89. SERVER.CPP    The implementation file for the server control object.
  90. FACTORY.H     The include file for the server's class factory COM objects.
  91. FACTORY.CPP   The implementation file for the server's class factories.
  92. BALL.H        The include file for the COBall COM object class.
  93. BALL.CPP      The implementation file for the COBall COM object class.
  94.