Conclien: Client of Connectable Components

The Conclien sample creates and uses the connectable COBall COM object that is housed in the Conserve server as the DllSndBall component. The Conclien client creates one COBall object and controls it through the IBall interface that the object exposes. Conclien sets up a system timer to use IBall to periodically move the ball and obtain updates of data describing the COBall object's position, size, and color. It uses that data, obtained by calling the IBall::GetBall method, to display graphical snapshot images of the ball in the client's main window.

Conclien also implements a COBallSink COM object and connects it to an appropriate connection point in the server's COBall object. In response to the system's WM_TIMER timer messages, which are sent periodically to the display window, Conclien uses the IBall interface to move and paint images of the ball. COBall also sends notifications back to Conclien, using the IBallSink interface, when the ball bounces off of a side of its bounding rectangle. Conclien responds to these event notifications to produce a different sound when the ball collides with a Top, Side, or Bottom boundary of the display window.

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; beep; beginpaint; bouncebottom; bounceleft; bounceright; bounceside; bouncetop; cguiball; checkmenuitem; cimpiballsink; cmainwindow; coballsink; cocreateinstance; cofreeunusedlibraries; coinitialize; combinergn; connectballsink; couninitialize; create; createellipticrgn; createrectrgn; createsolidbrush; defined; defwindowproc; delete_pointer; deleteobject; disconnectballsink; dispatchmessage; domenu; endpaint; errorbox; fillrect; fillrgn; findconnectionpoint; getball; getclassbrush; getclientrect; getconnectionpoint; getdc; gethwnd; getlasterror; getmenu; getmenustate; getmessage; getstockobject; getsystemmetrics; getusername; initapplication; initinstance; killtimer; loadaccelerators; loadcursor; loadicon; loadimage; loadstringa; makefamilypath; makeintresource; messageboxa; move; paintball; paintwin; postmessage; postquitmessage; queryinterface; readhelp; readsource; readtutorial; registerclassex; release; release_interface; releasedc; reset; restart; rgb; settimer; showdialog; showwindow; stdmethodimp_; style; succeeded; text; translateaccelerator; translatemessage; unadvise; unicodeok; updatewindow; windowproc; winmain