Leaked source code of windows server 2003
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.

94 lines
1.8 KiB

  1. #ifndef __CACT_HXX__
  2. #define __CACT_HXX__
  3. #include <otrack.hxx>
  4. #include <icube.h>
  5. #include <iballs.h>
  6. #define BEGIN_BLOCK do {
  7. #define EXIT_BLOCK break
  8. #define END_BLOCK }while(FALSE);
  9. class CTestAct : public IPersistFile, public IBalls, public IPersistStorage
  10. {
  11. public:
  12. CTestAct(REFCLSID rclsid);
  13. ~CTestAct(void);
  14. // IUnknown
  15. STDMETHOD(QueryInterface)(REFIID iid, void **ppv);
  16. STDMETHODIMP_(ULONG) AddRef(void);
  17. STDMETHODIMP_(ULONG) Release(void);
  18. // IPersist
  19. STDMETHOD(GetClassID)(LPCLSID lpClassID);
  20. // IPersistFile
  21. STDMETHOD(IsDirty)();
  22. STDMETHOD(Load)(LPCOLESTR lpszFileName, DWORD grfMode);
  23. STDMETHOD(Save)(LPCOLESTR lpszFileName, BOOL fRemember);
  24. STDMETHOD(SaveCompleted)(LPCOLESTR lpszFileName);
  25. STDMETHOD(GetCurFile)(LPOLESTR FAR * lpszFileName);
  26. // IPersistStorage
  27. STDMETHOD(InitNew)(LPSTORAGE pStg);
  28. STDMETHOD(Load)(LPSTORAGE pStg);
  29. STDMETHOD(Save)(
  30. LPSTORAGE pStgSave,
  31. BOOL fSameAsLoad);
  32. STDMETHOD(SaveCompleted)(LPSTORAGE pStgSaved);
  33. STDMETHOD(HandsOffStorage)(void);
  34. // IBalls
  35. STDMETHOD(MoveBall)(ULONG xPos, ULONG yPos);
  36. STDMETHOD(GetBallPos)(ULONG *xPos, ULONG *yPos);
  37. STDMETHOD(IsOverLapped)(IBalls *pIBall);
  38. STDMETHOD(IsContainedIn)(ICube *pICube);
  39. STDMETHOD(Clone)(IBalls **ppIBall);
  40. STDMETHOD(Echo)(IUnknown *punkIn, IUnknown**ppunkOut);
  41. private:
  42. HRESULT GetData(void);
  43. HRESULT SaveData(IStorage *pstg);
  44. REFCLSID _rclsid;
  45. IStorage * _pstg;
  46. OLECHAR _awszCurFile[MAX_PATH];
  47. BOOL _fDirty;
  48. BOOL _fSaveInprogress;
  49. ULONG _xPos;
  50. ULONG _yPos;
  51. DWORD _dwRegister;
  52. LONG _cRefs;
  53. };
  54. #endif // __CACT_HXX__