blob: 3b7f549b862e1234d115da5764ee060fbb12917d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
#ifndef __CTBALLS_HXX__
#define __CTBALLS_HXX__
#include <otrack.hxx>
#include <icube.h>
#include <iballs.h>
#define BEGIN_BLOCK do {
#define EXIT_BLOCK break
#define END_BLOCK }while(FALSE);
class CTestBalls : public IPersistFile, public IBalls, public IPersistStorage
{
public:
CTestBalls(REFCLSID rclsid);
~CTestBalls(void);
// IUnknown
STDMETHOD(QueryInterface)(REFIID iid, void **ppv);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
// IPersist
STDMETHOD(GetClassID)(LPCLSID lpClassID);
// IPersistFile
STDMETHOD(IsDirty)();
STDMETHOD(Load)(LPCOLESTR lpszFileName, DWORD grfMode);
STDMETHOD(Save)(LPCOLESTR lpszFileName, BOOL fRemember);
STDMETHOD(SaveCompleted)(LPCOLESTR lpszFileName);
STDMETHOD(GetCurFile)(LPOLESTR FAR * lpszFileName);
// IPersistStorage
STDMETHOD(InitNew)(LPSTORAGE pStg);
STDMETHOD(Load)(LPSTORAGE pStg);
STDMETHOD(Save)(
LPSTORAGE pStgSave,
BOOL fSameAsLoad);
STDMETHOD(SaveCompleted)(LPSTORAGE pStgSaved);
STDMETHOD(HandsOffStorage)(void);
// IBalls
STDMETHOD(MoveBall)(ULONG xPos, ULONG yPos);
STDMETHOD(GetBallPos)(ULONG *xPos, ULONG *yPos);
STDMETHOD(IsOverLapped)(IBalls *pIBall);
STDMETHOD(IsContainedIn)(ICube *pICube);
STDMETHOD(Clone)(IBalls **ppIBall);
STDMETHOD(Echo)(IUnknown *punkIn, IUnknown**ppunkOut);
private:
HRESULT GetData(void);
HRESULT SaveData(IStorage *pstg);
REFCLSID _rclsid;
IStorage * _pstg;
OLECHAR _awszCurFile[MAX_PATH];
BOOL _fDirty;
BOOL _fSaveInprogress;
ULONG _xPos;
ULONG _yPos;
DWORD _dwRegister;
LONG _cRefs;
};
#endif // __CTBALLS_HXX__
|