APTCLIEN - Client of an apartment model out-of-process local server SUMMARY ======= The APTCLIEN sample shows a client of several single-threaded apartments in the APTSERVE server. APTCLIEN's main purpose is to exercise and reveal for study the multiple apartments in the APTSERVE local out-of-process server. The following REMCLIEN sample, run in conjunction with APTCLIEN, shows the effects of multiple clients on the APTSERVE multithreaded server, with one client controlling from a remote machine. The COM objects that APTCLIEN manipulates are the car-related ones from previous samples in this tutorial series, with the following interfaces: ICar, IUtility, and ICruise. APTCLIEN works in conjunction with the separate APTSERVE.EXE, which provides the COCar, COUtilityCar, and COCruiseCar COM objects. APTCLIEN.EXE creates its own COUtilityCruiseCar COM object by reusing the COCruiseCar COM object by containment and augmenting it with a native implementation of the IUtility interface. Like LOCCLIEN, APTCLIEN's COUtilityCruiseCar composite object reuses COCruiseCar by containment. However, because COCruiseCar and COCar are in different apartments, COCruiseCar reuses COCar by containment rather than the aggregation shown in previous lessons. The composition of COUtilityCruiseCar is also interesting because the COUtilityCruiseCar object's containment of the COCruiseCar object crosses the process boundary between APTCLIEN and the out-of-process local server APTSERVE.EXE. In addition, COCruiseCar's containment of COCar crosses thread boundaries within APTSERVE. APTCLIEN uses standard marshaling support for the custom interfaces it uses on the COCruiseCar and COCar objects. This marshaling support is provided by the previous MARSHAL code sample, so you must build the MARSHAL code sample prior to building and running APTCLIEN and APTSERVE. For functional descriptions and a tutorial code tour of APTCLIEN, see the Code Tour section in APTCLIEN.HTM. For details on the external user operation of APTCLIEN, see both the Usage and Operation sections in APTCLIEN.HTM. To read APTCLIEN.HTM, run TUTORIAL.EXE in the main tutorial directory and click the APTCLIEN lesson in the table of lessons. You can also achieve the same thing by clicking the APTCLIEN.HTM file after locating the main tutorial directory in the Windows Explorer. See also APTSERVE.HTM in the main directory for more details on how APTSERVE works and exposes its services to APTCLIEN. You must build APTSERVE.EXE before building APTCLIEN. The makefile for APTSERVE automatically registers that server in the registry, so you must build APTSERVE before attempting to run APTCLIEN. 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 ----- APTCLIEN is an application that you can execute directly from Windows in the normal manner or from the Command Prompt window. No command line parameters are recognized by APTCLIEN. FILES ===== Files Description APTCLIEN.TXT This file. MAKEFILE The generic makefile for building the code sample application of this tutorial lesson. APTCLIEN.H The include file for the APTCLIEN application. Contains class declarations, function prototypes, and resource identifiers. APTCLIEN.CPP The main implementation file for APTCLIEN.EXE. Has WinMain and CMainWindow implementation, as well as the main menu dispatching. APTCLIEN.RC The application resource definition file. APTCLIEN.ICO The application icon resource. UTCRUCAR.H The class declaration for the COUtilityCruiseCar COM object. UTCRUCAR.CPP Implementation file for the COUtilityCruiseCar COM object. Also has the definition of the CreateUtilityCruiseCar function.