home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / tutsamp / locserve / locserve.txt < prev    next >
Text File  |  1997-08-05  |  5KB  |  112 lines

  1.  
  2. LOCSERVE - Local Server
  3.  
  4.  
  5. SUMMARY
  6. =======
  7.  
  8. The LOCSERVE sample begins with the car-related COM Objects of the previous
  9. DLLSERVE sample and rehouses them in an out-of-process local server,
  10. LOCSERVE.EXE. To do so requires little change to the COM objects themselves
  11. (COCar, COUtilityCar, and COCruiseCar). This sample introduces the new
  12. facilities to house them in a out-of-process COM server, including class
  13. factories for each component.
  14.  
  15. This out-of-process server provides the following components: LocCar,
  16. LocUtilityCar, and LocCruiseCar.
  17.  
  18. In the series of COM tutorial code samples, LOCSERVE works with the
  19. LOCCLIEN code sample to illustrate LOCSERVE's out-of-process local server
  20. facilities for creating components that can be used by an EXE client and
  21. the subsequent manipulation of those components by LOCCLIEN.EXE.
  22.  
  23. For functional descriptions and a tutorial code tour of LOCSERVE, see the
  24. Code Tour section in LOCSERVE.HTM. For details on setting up the
  25. programmatic usage of LOCSERVE, see the Usage section in LOCSERVE.HTM. To
  26. read LOCSERVE.HTM, run TUTORIAL.EXE in the main tutorial directory and
  27. click the LOCSERVE lesson in the table of lessons. You can also achieve
  28. the same thing by clicking the LOCSERVE.HTM file after locating the main
  29. tutorial directory in the Windows Explorer. See also LOCCLIEN.HTM in the
  30. main tutorial directory for more details on the LOCCLIEN client
  31. application and how it works with LOCSERVE.EXE itself. You must build
  32. LOCSERVE.EXE before building or running LOCCLIEN. LOCSERVE's makefile
  33. automatically registers LOCSERVE's components in the registry. These
  34. components must be registered before LOCSERVE is available to outside COM
  35. clients as a server for those components. This registration is done using
  36. the REGISTER.EXE utility built in the earlier REGISTER lesson. To build or
  37. run LOCSERVE, you should build the REGISTER code sample first.
  38.  
  39. As an out-of-process local server, LOCSERVE relies on standard marshaling
  40. for clients to use its interfaces across process boundaries. Such standard
  41. marshaling for the interfaces used in LOCSERVE's COM objects is provided
  42. in the MARSHAL.DLL server built in the previous lesson. To build or run
  43. LOCSERVE, you should build the MARSHAL code sample first.
  44.  
  45. For details on setting up your system to build and test the code samples
  46. in this COM Tutorial series, see TUTORIAL.HTM. The supplied MAKEFILE is
  47. Microsoft NMAKE-compatible. To create a debug build, issue the NMAKE
  48. command in the Command Prompt window.
  49.  
  50. Usage
  51. -----
  52.  
  53. LOCSERVE is an application that is meant to be used as an out-of-process COM
  54. server. Out-of-process servers like LOCSERVE are registered in the system
  55. registry, and LOCSERVE has built-in support for registering its components.
  56. It accepts the following command line switches to register and unregister:
  57.  
  58.     -RegServer or /RegServer to register
  59.     -UnregServer or /UnregServer to unregister
  60.  
  61. String matches on these switches are case-insensitive. As an out-of-process
  62. server, LOCSERVE also recognizes the standard -Embedding or /Embedding
  63. switch, which directs it to run as such a server. In this sample, that means
  64. LOCSERVE will run hidden. If you attempt to run LOCSERVE as a stand-alone
  65. application, it will exit with an error. You can manually direct LOCSERVE to
  66. run visible by starting it with an explicit -Embedding switch on its command
  67. line prior to running the LOCCLIEN client.
  68.  
  69. The makefile that builds this sample automatically registers the server in
  70. the registry. You can manually initiate its self-registration by issuing
  71. the following command at the command prompt in the LOCSERVE directory:
  72.  
  73.   nmake register
  74.  
  75. You can also directly invoke the REGISTER.EXE command at the command prompt
  76. while in the LOCSERVE directory.
  77.  
  78.   ..\register\register.exe locserve.exe
  79.  
  80. These registration commands require a prior build of the REGISTER sample
  81. in this series, as well as a prior build of LOCSERVE.EXE.
  82.  
  83.  
  84. FILES
  85. =====
  86.  
  87. Files        Description
  88.  
  89. LOCSERVE.TXT This file.
  90. MAKEFILE     The generic makefile for building the LOCSERVE.EXE
  91.              code sample of this tutorial lesson.
  92. LOCSERVE.H   The include file for the LOCSERVE application. Contains
  93.              class declarations, function prototypes, and resource
  94.              identifiers.
  95. LOCSERVE.CPP The main implementation file for LOCSERVE.EXE. Has WinMain
  96.              and CMainWindow implementation, as well as the main menu
  97.              dispatching.
  98. LOCSERVE.RC  The resource definition file for the executable.
  99. LOCSERVE.ICO The icon resource for the executable.
  100. SERVER.H     The include file for the server control C++ object. Also
  101.              used for LOCSERVE externs.
  102. SERVER.CPP   The implementation file for the server control object.
  103.              Manages object counts and creation of class factories.
  104. FACTORY.H    The include file for the server's class factory COM objects.
  105. FACTORY.CPP  The implementation file for the server's class factories.
  106. CAR.H        The include file for the COCar COM object class.
  107. CAR.CPP      The implementation file for the COCar COM object class.
  108. UTILCAR.H    The include file for the COUtililtyCar COM object class.
  109. UTILCAR.CPP  The implementation file for the COUtilityCar COM object class.
  110. CRUCAR.H     The include file for the COCruiseCar COM object class.
  111. CRUCAR.CPP   The implementation file for the COCruiseCar COM object class.
  112.