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 / licserve / licserve.txt < prev    next >
Encoding:
Text File  |  1997-08-05  |  5.3 KB  |  110 lines

  1.  
  2. LICSERVE - Licensed DLL Server
  3.  
  4.  
  5. SUMMARY
  6. =======
  7.  
  8. The LICSERVE sample introduces licensed components. LICSERVE modifies the
  9. COCruiseCar component of the DLLSERVE code sample and houses it as a
  10. licensed LicCruiseCar component in the LICSERVE.DLL COM server. This
  11. in-process server provides the components LicCruiseCar and LicCarSample.
  12. LicCarSample is the utility component that allows clients access to this
  13. server's logged behavior.
  14.  
  15. LICSERVE provides class factories for each of these components. The class
  16. factory for the LicCruiseCar component implements IClassFactory2, instead
  17. of the usual IClassFactory, to provide the licensing mechanism for this
  18. component. The LicCarSample component is not licensed and thus implements
  19. IClassFactory.
  20.  
  21. In the series of COM tutorial code samples, LICSERVE works with the
  22. LICCLIEN code sample to illustrate LICSERVE's COM server facilities for
  23. creating licensed components and supporting the subsequent manipulation of
  24. those components by the LICCLIEN.EXE client.
  25.  
  26. For functional descriptions and a tutorial code tour of LICSERVE, see the
  27. Code Tour section in LICSERVE.HTM. For details on setting up the
  28. programmatic usage of LICSERVE, see the Usage section in LICSERVE.HTM. To
  29. read LICSERVE.HTM, run TUTORIAL.EXE in the main tutorial directory and
  30. click the LICSERVE lesson in the table of lessons. You can also achieve
  31. the same thing by clicking the LICSERVE.HTM file after locating the main
  32. tutorial directory in the Windows Explorer. See also LICCLIEN.HTM in the
  33. main tutorial directory for more details on the LICCLIEN client
  34. application and how it works with LICSERVE.EXE itself. You must build
  35. LICSERVE.DLL before building or running LICCLIEN. LICSERVE's makefile
  36. automatically registers LICSERVE's components in the system registry.
  37. These components must be registered before LICSERVE is available to
  38. outside COM clients as a server for those components. This registration is
  39. done using the REGISTER.EXE utility built in the earlier REGISTER lesson.
  40. To build or run LICSERVE, you should build the REGISTER code sample first.
  41.  
  42. For details on setting up your system to build and test the code samples
  43. in this COM Tutorial series, see TUTORIAL.HTM. The supplied MAKEFILE
  44. is Microsoft NMAKE-compatible. To create a debug build, issue the NMAKE
  45. command in the Command Prompt window.
  46.  
  47. Usage
  48. -----
  49.  
  50. LICSERVE is a DLL that is meant to be used primarily as a licensed COM
  51. server. Though it can be implicitly loaded by linking to its associated
  52. .LIB file, it is normally used after an explicit LoadLibrary call, usually
  53. from COM's CoGetClassObject function. Servers like LICSERVE are registered
  54. in the registry. To use LICSERVE in a COM client program, a client does not
  55. need to include LICSERVE.H or link to LICSERVE.LIB. A COM client of LICSERVE
  56. obtains access solely through its components' CLSIDs and COM services. For
  57. LICSERVE, those CLSIDs are CLSID_LicCruiseCar and CLSID_LicCarSample. The
  58. LICCLIEN sample shows how this is done with the LicCruiseCar component that
  59. is licensed in the LICSERVE server.
  60.  
  61. The makefile that builds this sample automatically registers the server in
  62. the registry. You can manually initiate its self-registration by issuing
  63. the following command at the command prompt in the LICSERVE directory:
  64.  
  65.   nmake register
  66.  
  67. You can also directly invoke the REGISTER.EXE command at the command prompt
  68. while in the LICSERVE directory.
  69.  
  70.   ..\register\register.exe licserve.dll
  71.  
  72. These registration commands require a prior build of the REGISTER sample
  73. in this series, as well as a prior build of LICSERVE.DLL.
  74.  
  75. In this series, the makefiles use the REGISTER.EXE utility from the
  76. REGISTER sample. Recent releases of the Win32 Platform SDK and Visual C++
  77. include a utility, REGSVR32.EXE, which can be used in a similar fashion to
  78. register in-process servers and marshaling DLLs.
  79.  
  80.  
  81. FILES
  82. =====
  83.  
  84. Files        Description
  85.  
  86. LICSERVE.TXT This file.
  87. MAKEFILE     The generic makefile for building the LICSERVE.DLL
  88.              code sample of this tutorial lesson.
  89. LICSERVE.H   The include file for declaring as imported or defining as
  90.              exported the service functions in LICSERVE.DLL.
  91. LICSERVE.CPP The main implementation file for LICSERVE.DLL. Has DllMain
  92.              and the COM server functions (for example, DllGetClassObject).
  93. LICSERVE.DEF The module definition file. Exports server housing functions.
  94. LICSERVE.RC  The DLL resource definition file for the executable.
  95. LICSERVE.LIC The license file for this licensed COM server.
  96. LICSERVE.ICO The icon resource for the executable.
  97. SERVER.H     The include file for the server control C++ object. Also has
  98.              resource identifiers for resources stored in LICSERVE.DLL and
  99.              other extern declarations that are used internally within the
  100.              modules of LICSERVE.DLL.
  101. SERVER.CPP   The implementation file for the Server Control object.
  102. FACTORY.H    The include file for the server's class factory COM objects.
  103. FACTORY.CPP  The implementation file for the server's class factories.
  104. CRUCAR.H     The include file for the COLicCruiseCar COM object class.
  105. CRUCAR.CPP   The implementation file for the COLicCruiseCar COM object
  106.              class.
  107. SAMPLE.H     The include file for the COLicCarSample COM object class.
  108. SAMPLE.CPP   The implementation file for the COLicCarSample COM object
  109.              class.
  110.