home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / shell / fileview / readme.txt < prev    next >
Encoding:
Text File  |  1996-01-25  |  6.5 KB  |  119 lines

  1. File Viewer
  2.  
  3.  
  4. SUMMARY
  5. =======
  6.  
  7. The FILEVIEW sample demonstrates the basic steps to implement a simple
  8. text-based file viewer. This particular sample is a viewer for text files,
  9. those with the .TXT extension, as well as any compound file with the CLSID
  10. of CLSID_SampleTextFile, defined as 0x00021116-0000-C000-000000000046.
  11. The files FLATTEXT.TXT and COMPTEXT.TXT are two such files.
  12.  
  13. If you build the sample viewer and register it via the FVTEXT.REG file,
  14. you will be able to use the sample viewer. Note that the system has
  15. a .TXT file viewer installed by default. To disable the default viewer,
  16. rename the vsasc8.dll file in the system\viewers subdirectory or edit
  17. FVTEXT.REG and change the .TXT extension to another extension not
  18. supported by QuickView, like XXX, and then use text files with the XXX
  19. extension.
  20.  
  21. You can build the sample using Microsoft NMAKE. Be aware that building the
  22. sample produces a DLL. Once this DLL is registered, clicking with the right
  23. mouse button on one of the .TXT (XXX) files will display a context menu.
  24. Within this context menu, you will see the QuickView option. If you click on
  25. this menu item, the sample file viewer will be invoked.
  26.  
  27. MORE INFORMATION
  28. ================
  29.  
  30. This sample was designed to require only small amounts of modification
  31. to build a custom viewer and the areas where you would need to make
  32. changes are clearly marked in the source code. The FileViewer component 
  33. object itself used CLSID_FileViewerText:0x00021117-0000-C000-000000000046.  
  34. Do not use this CLSID yourself! You will need to create your own unique 
  35. CLSID using the GUIDGEN.EXE utility that comes with the SDK. 
  36.  
  37. This sample builds FVTEXT.DLL and places it in the 
  38. C:\WINDOWS\SYSTEM\VIEWERS directory. You need to create a different name
  39. for your own Viewer and use your particular system path. Rename the 
  40. following files to your custom name and make the indicated filename changes 
  41. within those files. 
  42.  
  43. Files        Description
  44.  
  45. FVTEXT.CPP   Main source file. Change occurrences of FVTEXT to your own 
  46.              name.
  47. FVTEXT.CPP   Contains the CFileViewer object implementation, where most of
  48.              the significant code is. There is not much in this file but
  49.              the CFileViewer member functions. Most of the functions will
  50.              require modification, depending on the type of viewer you
  51.              plan to implement. For the most part, most of the functions and
  52.              fields in CFileViewer need no modification. Those specific 
  53.              places needing modification are marked with MODIFY.
  54. FVTEXT.DEF   Module definition file. Change the LIBRARY and DESCRIPTION 
  55.              lines to match your implementation. NOTE: You must export
  56.              DllGetClassObject and DllCanUnloadNow.
  57. FVTEXT.H     Main object header file. Change occurrences of FVTEXT to your
  58.              own name.
  59.  
  60.              It is MOST IMPORTANT that you not use the CLSIDs defined here.
  61.              These are strictly for use with this sample. Use the SDK tool
  62.              GUIDGEN.EXE to generate your own unique CLSIDs.
  63. FVTEXT.ICO   Icon to use for FileViewer window. Use your own icon.
  64. FVTEXT.RC    Resources. Change the FVTEXT in the header and the references 
  65.              to fvtext.ico and fvtext.rcv to your own names.
  66. FVTEXT.RCV   Version information. Change FVTEXT in the header to your own 
  67.              name.
  68. FVTEXT.REG   Registry information for the FileViewer. Change the 
  69.              InprocServer32 entry (the last line) to your own DLL name. 
  70.              Change the extension from CPP to the extension you are 
  71.              supporting.
  72. MAKEFILE     This is an external makefile for use with NMAKE. It is not a
  73.              Visual C++ project file. In general, you will have to change 
  74.              the following macros definitions for a custom viewer:
  75.  
  76.              Macro           Location    Use
  77.  
  78.              DEFFILE         Line 24     Indicates your .DEF file
  79.              TARGET          Line 42     Indicates the name of the 
  80.                                          FileViewer. MAKEFILE assumes you 
  81.                                          have .CPP, .H, .RC, .RCV, and .ICO 
  82.                                          files with this name and are 
  83.                                          building a .DLL with this name.
  84.  
  85.              The dependency list at the bottom of the file should not need 
  86.              any modifications unless you rename other files or add new 
  87.              files. If you add new files, add them to the OBJS macro at 
  88.              line 58.
  89. CSTATHLP.CPP Definition and implementation of a class called CStatusHelper 
  90. CSTATHLP.H   that simplifies WM_MENUSELECT processing. To utilize this 
  91.              object, create one and call its MessageMap function (see 
  92.              CSTATHLP.CPP for documentation). You can then call its 
  93.              MenuSelect function to handle all WM_MENUSELECT messages. You 
  94.              can also ask CStatusHelper to display a specific message in 
  95.              the message map by calling MessageDisplay. You pass an 
  96.              identifier of the message in the message map and the 
  97.              CStatusHelper will go locate the string and display it.
  98. CSTRTABL.CPP Definition and implementation of a CStingTable class that
  99. CSTRTABL.H   simplifies stringtable management.
  100. DBGOUT.H     Contains a number of macros that help keep source code clean 
  101.              when including debug output and conditional code.
  102. IFILEVW.CPP  Implements the IFileViewer interface required of a FileViewer
  103.              using a class CImpIFileViewer (defined in FVTEXT.H). You should
  104.              not have to make any changes to this file. The IUnknown members
  105.              are delegated to CFileViewer's IUnknown implementation.
  106. IPERFILE.CPP Implements the IPersistFile interface for a FileViewer using
  107.              the class CImpIPersistFile.
  108. FILEVIEW.CPP
  109. FILEVIEW.H   The master header file for the entire sample that most of the
  110.              .CPP files include. It pulls in the other header files 
  111.              necessary for the specific viewer. In this sample, it brings in 
  112.              FVTEXT.H and RESOURCE.H. Your FileViewer should have a 
  113.              different name, so you'll want to change the reference to 
  114.              FVTEXT.H.
  115. FVPROC.CPP   Contains the window procedures for the frame window, the 
  116.              viewport window, and the about box. ViewportWndProc is what 
  117.              generates the display of the file. This will require major 
  118.              modifications depending on what you plan to do.
  119.