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 / fileview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-12  |  2.2 KB  |  85 lines

  1. //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  2. //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  3. //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright  1994-1996  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. //    PROGRAM: FILEVIEW.H    
  9. //
  10. //    PURPOSE:   File Viewer Component Object to work with Windows 95 Explorer.
  11. //      Definitions, classes, and prototypes for a FileViewer DLL.
  12. //    Necessary modifications marked with MODIFY
  13. //
  14. //    PLATFORMS:    Windows 95
  15. //
  16. //    SPECIAL INSTRUCTIONS: N/A
  17. //
  18. #ifndef _FILEVIEW_H_
  19. #define _FILEVIEW_H_
  20.  
  21.  
  22. //Prevent windows.h from pulling in OLE 1
  23. #define INC_OLE2
  24.  
  25. #include <windows.h>
  26. #include <stdlib.h>
  27. #include <ole2.h>
  28. #include <commdlg.h>
  29. #include <shlobj.h>
  30.  
  31.  
  32. #include "dbgout.h"
  33. #include "cstrtabl.h"
  34. #include "cstathlp.h"
  35.  
  36. //Types needed for other include files.
  37. #ifndef PPVOID
  38. typedef LPVOID * PPVOID;
  39. #endif
  40.  
  41.  
  42. /*
  43.  * Type and function for an object-destroyed callback.  An
  44.  * Object will call ObjectDestoyed in FILEVIEW.CPP when it
  45.  * deletes itself.  That way the server code, independent
  46.  * of the object, can implement DllCanUnloadNow properly.
  47.  */
  48. typedef void (WINAPI *PFNDESTROYED)(void);
  49. void WINAPI ObjectDestroyed(void);
  50.  
  51.  
  52. //MODIFY:  Other viewer-specific headers
  53. #include "fvtext.h"     //FileViewer specifics
  54. #include "resource.h"   //Resource definitions
  55.  
  56.  
  57.  
  58. //FILEVIEW.CPP
  59. HRESULT PASCAL DllGetClassObject(REFCLSID, REFIID, PPVOID);
  60. STDAPI         DllCanUnloadNow(void);
  61.  
  62. //A class factory that creates CFileViewer objects
  63. class CFVClassFactory : public IClassFactory
  64.     {
  65.     protected:
  66.         ULONG           m_cRef;
  67.  
  68.     public:
  69.         CFVClassFactory(void);
  70.         ~CFVClassFactory(void);
  71.  
  72.         //IUnknown members
  73.         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
  74.         STDMETHODIMP_(ULONG) AddRef(void);
  75.         STDMETHODIMP_(ULONG) Release(void);
  76.  
  77.         //IClassFactory members
  78.         STDMETHODIMP         CreateInstance(LPUNKNOWN, REFIID, PPVOID);
  79.         STDMETHODIMP         LockServer(BOOL);
  80.     };
  81.  
  82. typedef CFVClassFactory *PCFVClassFactory;
  83.  
  84. #endif //_FILEVIEW_H_
  85.