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 / stoclien / stoclien.txt < prev   
Encoding:
Text File  |  1997-08-05  |  5.5 KB  |  113 lines

  1.  
  2. STOCLIEN - Client of structured storage server
  3.  
  4.  
  5. SUMMARY
  6. =======
  7.  
  8. The STOCLIEN sample introduces a simple drawing application. The user can
  9. use a mouse or tablet device to do free-form drawing in the client window.
  10. The color and width of the electronic ink can be chosen, and the drawings
  11. can be saved in files.
  12.  
  13. The functionality is externally similar to other "scribble" C++ tutorial
  14. samples. The difference in the STOCLIEN/STOSERVE samples is an internal
  15. architecture based on COM technology. A clear architectural distinction is
  16. kept between COM client and COM server. A COPaper COM object encapsulates
  17. only the server-based storage of the drawing paper data: No graphical user
  18. interface (GUI) behavior is provided on the server side. All GUI behavior
  19. is isolated in the client. The data managment and storage features of
  20. COPaper objects are available only through an COM custom interface,
  21. IPaper.
  22.  
  23. STOCLIEN can load and save its drawings in the structured storage of COM
  24. compound files. The principal focus of the STOCLIEN sample is how the
  25. client uses this structured storage and how it directs a server component
  26. to use this storage. The programming of structured storage services is
  27. shown in the sample.
  28.  
  29. The STOCLIEN sample creates and uses the connectable COPaper COM object
  30. that is provided as the CLSID_DllPaper component in the STOSERVE server.
  31. The STOCLIEN client creates a COPaper object and controls it through the
  32. IPaper interface that the object exposes. STOCLIEN obtains drawing data
  33. from the user and graphically represents it in a window that it manages.
  34. STOCLIEN uses COPaper's IPaper interface to save the drawing data in
  35. COPaper and to direct file storage operations on this data.
  36.  
  37. STOCLIEN cooperates with the COPaper to load and save COPaper's drawing
  38. data. STOCLIEN obtains an IStorage interface for the storage object in a
  39. compound file. In its load and save operations, STOCLIEN passes a pointer
  40. to this IStorage interface to COPaper in the server. COPaper uses the
  41. provided IStorage to create streams in the storage. COPaper can then use
  42. the standard IStream interface for reading and writing the drawing data it
  43. manages.
  44.  
  45. COPaper only manages the drawing data; it performs no GUI actions.
  46. STOCLIEN provides the GUI for the drawing application. It encapsulates
  47. this in a central CGuiPaper C++ object.
  48.  
  49. STOCLIEN also implements the custom IPaperSink interface in a COPaperSink
  50. COM object and connects this interface to an appropriate connection point
  51. in the server's COPaper object. COPaper uses the connected IPaperSink
  52. interface to send notifications back to STOCLIEN. The normal GUI
  53. repainting of COPaper's drawing data is done in STOCLIEN using COPaper's
  54. connectable object technology.
  55.  
  56. For functional descriptions and a tutorial code tour of STOCLIEN, see the
  57. Code Tour section in STOCLIEN.HTM. For details on the external user
  58. operation of STOCLIEN, see both the Usage and Operation sections in
  59. STOCLIEN.HTM. To read STOCLIEN.HTM, run TUTORIAL.EXE in the main tutorial
  60. directory and click the STOCLIEN lesson in the table of lessons. You can
  61. also achieve the same thing by clicking the STOCLIEN.HTM file after
  62. locating the main tutorial directory in the Windows Explorer. See also
  63. STOSERVE.HTM in the main tutorial directory for more details on how
  64. STOSERVE works and exposes its services to STOCLIEN. You must build the
  65. STOSERVE DLL before building STOCLIEN. The makefile for STOSERVE
  66. automatically registers that server in the system registry, so you must
  67. build STOSERVE before attempting to run STOCLIEN.
  68.  
  69. For details on setting up your system to build and test the code samples
  70. in this COM Tutorial series, see TUTORIAL.HTM. The supplied MAKEFILE is
  71. Microsoft NMAKE-compatible. To create a debug build, issue the NMAKE
  72. command in the Command Prompt window.
  73.  
  74. Usage
  75. -----
  76.  
  77. STOCLIEN is an application that you can execute directly from Windows in
  78. the normal manner or from the Command Prompt window. STOCLIEN accepts an
  79. optional file name parameter on the command line. For example:
  80.  
  81.   STOCLIEN c:\drawings\drawing.pap
  82.  
  83. Where drawing.pap is a compound file containing DllPaper-compatible
  84. structured storage of drawing data. If no command line file name parameter
  85. is specified, STOCLIEN uses the default file name STOCLIEN.PAP and
  86. attempts to open it in the same directory as the executing STOCLIEN.EXE.
  87.  
  88.  
  89. FILES
  90. =====
  91.  
  92. Files          Description
  93.  
  94. STOCLIEN.TXT   This file.
  95. MAKEFILE       The generic makefile for building the code sample
  96.                application of this tutorial lesson.
  97. STOCLIEN.H     The include file for the STOCLIEN application. Contains
  98.                class declarations, function prototypes, and resource
  99.                identifiers.
  100. STOCLIEN.CPP   The main implementation file for STOCLIEN.EXE. Has WinMain
  101.                and CMainWindow implementation, as well as the main menu
  102.                dispatching.
  103. STOCLIEN.RC    The application resource definition file.
  104. STOCLIEN.ICO   The application icon resource.
  105. STOCLIEN.PAP   A default paper drawing file for the application.
  106. PENCIL.CUR     A pencil image for the client window cursor.
  107. SINK.H         The class declaration for the COPaperSink COM object class.
  108. SINK.CPP       Implementation file for the COPaperSink COM object class.
  109. PAPFILE.H      The class declaration for the CPapFile C++ class.
  110. PAPFILE.CPP    Implementation file for the CPapFile C++ class.
  111. GUIPAPER.H     The class declaration for the CGuiPaper C++ class.
  112. GUIPAPER.CPP   Implementation file for the CGuiPaper C++ class.
  113.