home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / command.ext / readme.txt < prev    next >
Encoding:
Text File  |  1996-01-15  |  3.8 KB  |  80 lines

  1. Custom Command Extentions
  2.  
  3.  
  4. SUMMARY
  5. =======
  6.  
  7. The Command.Ext sample demonstrates how to implement custom command extensions
  8. for the Microsoft Exchange Client. In particular, it demonstrates:
  9.  
  10.   - adding a menu command
  11.   - adding a toolbar button
  12.   - disabling/enabling the menu item and toolbar item depending what object
  13.     is selected in the viewer
  14.   - making MAPI calls from an extension
  15.   - extending a command in the Main Viewer and the Search Viewer dialog
  16.   - F1 response for context help on the menu item
  17.   - Implementing custom Tooltip and Status Bar text
  18.  
  19. The custom command displays the number of subfolders, read messages, and
  20. unread messages in a selected folder.
  21.  
  22. MORE INFORMATION
  23. ================
  24.  
  25. This sample requires Microsoft Windows NT 3.51 or Windows 95, the MAPI 1.0
  26. PDK, Microsoft Visual C++ version 2.0 (or later), and the Win32 SDK.
  27.  
  28.  
  29. To configure Microsoft Exchange to use the client extension, place the
  30. following REG_SZ entry in the system registry in
  31. HKEY_LOCAL_MACHINE\Software\Microsoft\Exchange\Client\Extensions:
  32.  
  33.     Sample Command Extension=4.0;c:\<path>\CMDEXT32.dll;1;01010000000000
  34.  
  35. You can leave out an explicit path to CMDEXT32.DLL if it resides in a
  36. directory listed in the system PATH.
  37.  
  38. Exchange client extensions are designed using OLE's Component Object Model.
  39. The client calls methods which are provided in the extension. In some
  40. calls to the extension interface, a pointer to a callback interface
  41. (IExchExtCallback) for the extension to call back into the Exchange client.
  42. For more information read "Extending the Microsoft Exchange Client" in the
  43. MAPI PDK documentation.
  44.  
  45. This sample implements three interface objects: IExchExt, IExchExtCommands,
  46. and IExchExtUserEvents. To extend the command set of Exchange, it is
  47. necessary to provide implementations for IExchExt and IExchExtCommands.
  48. It is optional to provide implementation for IExchExtUserEvents. This sample
  49. implements IExchExtUserEvents to enable or disable the custom command,
  50. depending on what object the user is selecting in the Exchange main viewer.
  51. The menu item is always enabled in the Search Folder Dialog.
  52.  
  53. The custom command is available in both the Main viewer and the Search
  54. Folder Dialog. The IExchExtCommands provides an interface for the client to
  55. display context help on the custom menu item and to display tooltip text and
  56. status window text.  Select the custom menu item and press F1 to pop-up an
  57. About dialog box.
  58.  
  59. This extension works in two different contexts, main viewer and search dialog.
  60. For each context an extension supports, a complete set of interface objects
  61. is created. In this sample, the MyExchExt, MyExchExtCommands and
  62. MyExchExtUserEvents objects are created once for the main viewer context and
  63. once for the search dialog. However, because there is only one
  64. implementation for all contexts, there is a context flag data member which
  65. indicates which context Exchange is calling from.
  66.  
  67. A context in many cases corresponds to a user interface. For example, the
  68. search viewer is one context and the main viewer is another. QueryInterface
  69. is called for each IID for each context. In this example, QueryInterface is
  70. called each time for all IIDs in the main viewer context when
  71. Exchange first starts. QueryInterface is called again each time for all
  72. IIDs in the search viewer context. For each of the contexts, a unique pointer
  73. to the MyExchExtCommands and MyExchExtUserEvents objects is returned to
  74. Exchange in the QueryInterface call. Then when Exchange is calling
  75. DoCommands from the search viewer, it is calling the one using the interface
  76. pointer returned to it through QueryInterface in the search viewer context.
  77. And when Exchange is calling DoCommands from the main viewer, it is calling
  78. the one using the interface pointer returned to it through QueryInterface in
  79. the main viewer context.
  80.