home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Windows Gam…ming Gurus (2nd Edition)
/
Disc2.iso
/
msdn_vcb
/
samples
/
vc98
/
sdk
/
com
/
tutsamp
/
conclien
/
conclien.txt
< prev
next >
Wrap
Text File
|
1997-08-05
|
4KB
|
81 lines
CONCLIEN - Client of Connectable Components
SUMMARY
=======
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 timer's WM_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.
For functional descriptions and a tutorial code tour of CONCLIEN, see the
Code Tour section in CONCLIEN.HTM. For details on the external user
operation of CONCLIEN, see both the Usage and Operation sections in
CONCLIEN.HTM. To read CONCLIEN.HTM, run TUTORIAL.EXE in the main tutorial
directory and click the CONCLIEN lesson in the table of lessons. You can
also achieve the same thing by clicking the CONCLIEN.HTM file after
locating the main tutorial directory in the Windows Explorer. See also
CONSERVE.HTM in the main tutorial directory for more details on how
CONSERVE works and exposes its services to CONCLIEN. You must build the
CONSERVE DLL before building CONCLIEN. The makefile for CONSERVE
automatically registers that server in the system registry, so you must
build CONSERVE before attempting to run CONCLIEN.
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
-----
CONCLIEN 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 CONCLIEN.
The Win32 Beep function is used in this sample to produce ball bounce
sounds of various frequencies. This works under Windows NT 4.0 and later.
Under the Windows 95 operating system, the Win32 Beep function currently
uses whatever is assigned in the Control Panel's Sound dialog for the
default sound and thus ignores the frequency values passed to Beep. Under
current releases of Windows 95, the sound will not be different when the
ball collides with the top, bottom, or side of the display window.
FILES
=====
Files Description
CONCLIEN.TXT This file.
MAKEFILE The generic makefile for building the code sample
application of this tutorial lesson.
CONCLIEN.H The include file for the CONCLIEN application. Contains
class declarations, function prototypes, and resource
identifiers.
CONCLIEN.CPP The main implementation file for CONCLIEN.EXE. Has WinMain
and CMainWindow implementation, as well as the main menu
dispatching.
CONCLIEN.RC The application resource definition file.
CONCLIEN.ICO The application icon resource.
SINK.H The class declaration for the COBallSink class.
SINK.CPP Implementation file for the COBallSink class.
GUIBALL.H The class declaration for the CGuiBall C++ class.
GUIBALL.CPP Implementation file for the CGuiBall C++ class.