Locserve: Local Server
Note This sample requires a prior build of the Register and Marshal samples.
The Locserve sample works with the Locclien code sample to illustrate Locserve's out-of-process local server facilities for creating components that can be used by an EXE client and the subsequent manipulation of those components by Locclien.exe.
The Locserve sample begins with the automobile-related COM objects of the DLLserve sample and rehouses them in an out-of-process local server, Locserve.exe. To do so requires little change to the COM objects themselves (COCar, COUtilityCar, and COCruiseCar). This sample introduces the new facilities to house them in a out-of-process COM server, including class factories for each component.
This out-of-process server provides the following components: LocCar, LocUtilityCar, and LocCruiseCar.
For functional descriptions and a code tour of Locserve, see the Code Tour section in Locserve.txt (one of the Locserve project files). See also Locclien.txt in the sibling \Locclien directory for more details on the Locclien client application and how it works with Locserve.exe itself. You must build Locserve.exe before building or running Locclien. Locserve's makefile automatically registers Locserve's components in the registry. These components must be registered before Locserve is available to outside COM clients as a server for those components. This registration is done using the Register.exe utility built in the Register sample.
As an out-of-process local server, Locserve relies on standard marshaling for clients to use its interfaces across process boundaries. Such standard marshaling for the interfaces used in Locserve's COM objects is provided in the Marshal.dll server built in the Locclien sample.
See the parent topic, COM Tutorial Samples, to download global tutorial files or any HTML files about this sample.
Building SDK Samples
This sample uses the following keywords:
addref; adjust; cfcar; cfcruisecar; cfutilitycar; cimpicar; cimpiclassfactory; cimpicruise; cimpiutility; clear; closefactories; clutch; cmainwindow; cocar; cocreateinstance; cocruisecar; coinitialize; copy; coregisterclassobject; corevokeclassobject; couninitialize; coutilitycar; create; createinstance; createserverlog; cserver; defined; defwindowproc; delete_pointer; dispatchmessage; domenu; engage; errorbox; failed; findwindow; getlasterror; getmenu; getmessage; getmodulefilename; getsystemmetrics; getusername; initapplication; initinstance; interlockeddecrement; interlockedincrement; iswindow; loadcursor; loadicon; loadimage; loadstringa; lock; lockserver; log; logerror; logf1; logid; logtoserver; lstrcat; lstrcmpia; lstrcpy; lstrlen; makeintresource; messageboxa; objectsdown; objectsup; offroad; openfactories; postmessage; postquitmessage; queryinterface; regclosekey; regcreatekeyex; regdeletekey; registerclassex; registerserver; regsetvalueex; release; release_interface; setclient; setregkeyvalue; shift; showdialog; showwindow; speed; stdmethodimp_; steer; stringfromguid2; style; succeeded; text; translatemessage; unicodeok; unlock; unregisterserver; updatewindow; winch; windowproc; winmain; wsprintf