DCOMDraw: Client of Structured Storage Server

Note   To use this sample, you must first build (or otherwise register) the DCDMarsh sample on the client and server, and you must first build DCDServe on the remote machine.

The DCOMDraw, DCDServe, and DCDMarsh samples together form a distributed drawing application. Using Distributed COM (DCOM) technology, they allow users on different client machines in a network to interactively draw on a shared drawing. All DCOMDraw clients see the same drawing and any client can take ownership of the pen to draw. The user of DCOMDraw can use a mouse or tablet device to draw in the client window and can choose the color and width of the electronic ink. As clients draw, the application echoes the drawing activity from DCDServe to all connected clients using DCOM over the network. Although these samples do not build an optimized and complete application, the functionality is suggestive of the shared whiteboards offered by some workgroup applications.

Although DCOMDraw, DCDServe, and DCDMarsh work on the same machine across process boundaries, the main goal is to provide a distributed application that enables multiple DCOMDraw clients on different machines to access a single shared drawing object housed in a DCDServe server running on a common server machine. A typical scenario would have numerous client machines connected to an intranet consisting of a Windows NT network domain or peer-to-peer workgroup. DCOMDraw can run on any of these client machines. DCDServe is installed and runs on a common server machine in the domain. The user of the DCOMDraw client can interactively choose the remote server machine to determine which DCDServe COM server to use for the shared drawing.

DCDServe manages a shared, single COPaper COM object that models a sheet of white drawing paper. Clients can use the methods of the COPaper object to draw on the paper surface using "ink" of specified color and width. This functionality is outwardly similar to the Scribble tutorial samples included with Microsoft Visual C++. The drawing paper features of COPaper objects are exposed to DCOMDraw clients by a custom ISharePaper interface. COPaper implements the ISharePaper interface. A clear architectural distinction is kept between client and server. No graphical user interface (GUI) is provided by the COPaper object. It relies on the DCOMDraw client for all GUI behavior. COPaper encapsulates only the server-based capture and storage of the drawn ink data.

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; advise; ansitouc; asksave; beep; beginpaint; cguipaper; checkmenuitem; choosecolor; cimpipapersink; clearwin; cmainwindow; cocreateinstance; cocreateinstanceex; cofreeunusedlibraries; coinitialize; coinitializesecurity; connectpapersink; copapersink; couninitialize; create; createpen; dcomok; defined; defwindowproc; delete_pointer; deleteobject; dialogproc; disconnectpapersink; dispatchmessage; domenu; enddialog; endpaint; erase; erased; errorbox; failed; fillrect; findconnectionpoint; getclassbrush; getclientrect; getconnectionpoint; getdc; getdlgitem; getdlgitemtext; gethwnd; getink; getlasterror; getmenu; getmessage; getstockobject; getsystemmetrics; getusername; hrmsg; initapplication; initinstance; initpaper; inkcolor; inkdraw; inkstart; inkstop; inkwidth; lineto; load; loadaccelerators; loadcursor; loaded; loadicon; loadimage; loadlocal; loadremote; loadstring; loadstringa; lock; locked; lstrcat; lstrcpy; makefamilypath; makeintresource; master; memset; messagebox; messageboxa; movetoex; paintwin; pickcolor; postmessage; postquitmessage; queryinterface; readhelp; readsource; readtutorial; registerclassex; release; release_interface; releasecapture; resize; resized; resizewin; rgb; save; saved; selectobject; setcapture; setclasslong; setcursor; setdlgitemtext; setfocus; setpencur; setwindowpos; setwindowtext; showdialog; showwindow; stdmethodimp_; style; succeeded; text; translateaccelerator; translatemessage; unadvise; unicodeok; unlocked; updatewindow; windowproc; winmain