Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.4 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: advbnd.hxx
  4. //
  5. // Contents: This file contins the advanced binding test class
  6. //
  7. // Classes: CAdvBndCF (class factory)
  8. // CAdvBnd
  9. //
  10. // History: 30-Mar-92 SarahJ Created
  11. //
  12. //---------------------------------------------------------------------
  13. #ifndef __ADVBND_H__
  14. #define __ADVBND_H__
  15. //#include <win4p.hxx>
  16. #include <smartp.hxx>
  17. extern "C" const GUID CLSID_BasicBnd;
  18. extern "C" const GUID CLSID_AdvBnd;
  19. // DefineSmartItfP(IClassFactory)
  20. //+-------------------------------------------------------------------
  21. //
  22. // Class: CBasicBndCF
  23. //
  24. // Synopsis: Class Factory for CBasicBnd
  25. //
  26. // Methods: IUnknown - QueryInterface, AddRef, Release
  27. // IClassFactory - CreateInstance
  28. //
  29. // History: 21-Mar-92 SarahJ Created
  30. //
  31. //--------------------------------------------------------------------
  32. class CAdvBndCF: public IClassFactory
  33. {
  34. public:
  35. // Constructor/Destructor
  36. CAdvBndCF();
  37. ~CAdvBndCF();
  38. static IClassFactory FAR * Create();
  39. // IUnknown
  40. STDMETHOD(QueryInterface)(REFIID iid, void FAR * FAR * ppv);
  41. STDMETHOD_(ULONG, AddRef)(void);
  42. STDMETHOD_(ULONG, Release)(void);
  43. // IClassFactory
  44. STDMETHOD(CreateInstance)(IUnknown FAR* pUnkOuter,
  45. REFIID iidInterface,
  46. void FAR* FAR* ppv);
  47. STDMETHOD(LockServer)(BOOL fLock);
  48. private:
  49. IClassFactory *_pCF;
  50. DWORD _dwRegistration;
  51. ULONG _cRefs;
  52. };
  53. //+-------------------------------------------------------------------
  54. //
  55. // Class: CAdvBnd
  56. //
  57. // Synopsis: Test class CBasicBnd
  58. //
  59. // Methods:
  60. //
  61. // History: 21-Mar-92 SarahJ Created
  62. //
  63. //--------------------------------------------------------------------
  64. class CAdvBnd: public IPersistFile
  65. {
  66. public:
  67. CAdvBnd(IClassFactory *pFactory);
  68. ~CAdvBnd();
  69. // IUnknown
  70. STDMETHOD(QueryInterface)(REFIID iid, void FAR * FAR * ppv);
  71. STDMETHOD_(ULONG, AddRef)(void);
  72. STDMETHOD_(ULONG, Release)(void);
  73. // IPersitFile
  74. STDMETHOD(GetClassID)(LPCLSID lpClassID);
  75. STDMETHOD(IsDirty)();
  76. STDMETHOD(Load)(LPCOLESTR lpszFileName, DWORD grfMode);
  77. STDMETHOD(Save)(LPCOLESTR lpszFileName, BOOL fRemember);
  78. STDMETHOD(SaveCompleted)(LPCOLESTR lpszFileName);
  79. STDMETHOD(GetCurFile)(LPOLESTR FAR * lpszFileName);
  80. private:
  81. XIUnknown _xiunk;
  82. DWORD _dwRegister;
  83. ULONG _cRefs;
  84. };
  85. #endif // __ADVBND_H__