LICSERVE - Licensed DLL Server SUMMARY ======= The LICSERVE sample introduces licensed components. LICSERVE modifies the COCruiseCar component of the DLLSERVE code sample and houses it as a licensed LicCruiseCar component in the LICSERVE.DLL COM server. This in-process server provides the components LicCruiseCar and LicCarSample. LicCarSample is the utility component that allows clients access to this server's logged behavior. LICSERVE provides class factories for each of these components. The class factory for the LicCruiseCar component implements IClassFactory2, instead of the usual IClassFactory, to provide the licensing mechanism for this component. The LicCarSample component is not licensed and thus implements IClassFactory. In the series of COM tutorial code samples, LICSERVE works with the LICCLIEN code sample to illustrate LICSERVE's COM server facilities for creating licensed components and supporting the subsequent manipulation of those components by the LICCLIEN.EXE client. For functional descriptions and a tutorial code tour of LICSERVE, see the Code Tour section in LICSERVE.HTM. For details on setting up the programmatic usage of LICSERVE, see the Usage section in LICSERVE.HTM. To read LICSERVE.HTM, run TUTORIAL.EXE in the main tutorial directory and click the LICSERVE lesson in the table of lessons. You can also achieve the same thing by clicking the LICSERVE.HTM file after locating the main tutorial directory in the Windows Explorer. See also LICCLIEN.HTM in the main tutorial directory for more details on the LICCLIEN client application and how it works with LICSERVE.EXE itself. You must build LICSERVE.DLL before building or running LICCLIEN. LICSERVE's makefile automatically registers LICSERVE's components in the system registry. These components must be registered before LICSERVE is available to outside COM clients as a server for those components. This registration is done using the REGISTER.EXE utility built in the earlier REGISTER lesson. To build or run LICSERVE, you should build the REGISTER code sample first. For details on setting up your system to build and test the code samples in this COM Tutorial series, see TUTORIAL.HTM. The supplied MAKEFILE is Microsoft NMAKE-compatible. To create a debug build, issue the NMAKE command in the Command Prompt window. Usage ----- LICSERVE is a DLL that is meant to be used primarily as a licensed COM server. Though it can be implicitly loaded by linking to its associated .LIB file, it is normally used after an explicit LoadLibrary call, usually from COM's CoGetClassObject function. Servers like LICSERVE are registered in the registry. To use LICSERVE in a COM client program, a client does not need to include LICSERVE.H or link to LICSERVE.LIB. A COM client of LICSERVE obtains access solely through its components' CLSIDs and COM services. For LICSERVE, those CLSIDs are CLSID_LicCruiseCar and CLSID_LicCarSample. The LICCLIEN sample shows how this is done with the LicCruiseCar component that is licensed in the LICSERVE server. The makefile that builds this sample automatically registers the server in the registry. You can manually initiate its self-registration by issuing the following command at the command prompt in the LICSERVE directory: nmake register You can also directly invoke the REGISTER.EXE command at the command prompt while in the LICSERVE directory. ..\register\register.exe licserve.dll These registration commands require a prior build of the REGISTER sample in this series, as well as a prior build of LICSERVE.DLL. In this series, the makefiles use the REGISTER.EXE utility from the REGISTER sample. Recent releases of the Win32 Platform SDK and Visual C++ include a utility, REGSVR32.EXE, which can be used in a similar fashion to register in-process servers and marshaling DLLs. FILES ===== Files Description LICSERVE.TXT This file. MAKEFILE The generic makefile for building the LICSERVE.DLL code sample of this tutorial lesson. LICSERVE.H The include file for declaring as imported or defining as exported the service functions in LICSERVE.DLL. LICSERVE.CPP The main implementation file for LICSERVE.DLL. Has DllMain and the COM server functions (for example, DllGetClassObject). LICSERVE.DEF The module definition file. Exports server housing functions. LICSERVE.RC The DLL resource definition file for the executable. LICSERVE.LIC The license file for this licensed COM server. LICSERVE.ICO The icon resource for the executable. SERVER.H The include file for the server control C++ object. Also has resource identifiers for resources stored in LICSERVE.DLL and other extern declarations that are used internally within the modules of LICSERVE.DLL. SERVER.CPP The implementation file for the Server Control object. FACTORY.H The include file for the server's class factory COM objects. FACTORY.CPP The implementation file for the server's class factories. CRUCAR.H The include file for the COLicCruiseCar COM object class. CRUCAR.CPP The implementation file for the COLicCruiseCar COM object class. SAMPLE.H The include file for the COLicCarSample COM object class. SAMPLE.CPP The implementation file for the COLicCarSample COM object class.