home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / com / connect / connect.txt next >
Text File  |  1998-04-02  |  2KB  |  38 lines

  1.  
  2. NOTE:
  3.     This is a modification of the Atl sample connect, to demonstrate VCCOM
  4. support for connection point sinks.  drive is a naive implementaion, whereas
  5. mdrive slightly belabors COM-correctness in using a ClassFactory to create
  6. sink objects.  Neither drive nor mdrive are dependent upon ATL or MFC for
  7. any COM support.
  8.  
  9. CONNECT
  10.  
  11. This sample illustrates the use and implementation of connection points (the ICOnnectionPointContainer
  12. and IConnectionPoint interfaces)in a multithreaded environment.
  13.  
  14. The server is implemented in the CONNECT.DLL. This DLL allows the creation of a CoRandom COM object,
  15. implemented by the CRandom C++ class. The COM object supports IRandom (a dual interface)and 
  16. IConnectionPointContainer, and it accepts connections for the IRandomEvent interface.
  17.  
  18. The IRandom interface supports the following methods:
  19.     Start(): starts a thread inside the object
  20.     Stop(): stops a thread inside the object
  21.     StopAll(): stops all the running threads
  22.  
  23. When running, the secondary threads inside the object keep firing events through the connection point.
  24.  
  25. Two clients are provided: DRIVE and MDRIVE. They can be found in the DRIVE and MDRIVE subdirectories.
  26.  
  27. DRIVE.EXE is a simple console application that provides a single object implementing the IRandomEvent
  28. interface. It creates a CoRandom object, calls Advise()/Unadvise() on the connection point, and has the 
  29. CoRandom object fire events into the drive's object.
  30.  
  31. MDRIVE.EXE is an MFC dialog based application, able to create multiple advise sinks and to control the
  32. number of threads the server creates.
  33.  
  34. HOW TO RUN IT:
  35.  
  36. Build CONNECT.DLL and register it. You can build and run DRIVE.EXE from a console, or build and run MDRIVE.EXE
  37. directly from Developer Studio.
  38.