Annotation of mstools/ole20/samples/dispdemo/crempoly.h, revision 1.1.1.1

1.1       root        1: /*** 
                      2: *crempoly.h
                      3: *
                      4: *  Copyright (C) 1992, Microsoft Corporation.  All Rights Reserved.
                      5: *  Information Contained Herein Is Proprietary and Confidential.
                      6: *
                      7: *Purpose:
                      8: *  This file defines the CRemPoly remote polygon object.
                      9: *
                     10: *Implementation Notes:
                     11: *
                     12: *****************************************************************************/
                     13: 
                     14: 
                     15: class CRemPoint : public IUnknown {
                     16: public:
                     17:     static CRemPoint FAR* Create(void);
                     18: 
                     19:     // standard IUnknown methods
                     20:     STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppvObj);
                     21:     STDMETHOD_(unsigned long, AddRef)(void);
                     22:     STDMETHOD_(unsigned long, Release)(void);
                     23: 
                     24:     short GetX();
                     25:     void SetX(short x);
                     26:     short GetY();
                     27:     void SetY(short y);
                     28: 
                     29: private:
                     30:     CRemPoint() { m_refs = 0; }
                     31: 
                     32:     unsigned long m_refs;
                     33:     IDispatch FAR* m_pdisp;
                     34: };
                     35: 
                     36: 
                     37: class CRemPoly : public IUnknown {
                     38: public:
                     39:     static HRESULT Create(CLSID clsid, CRemPoly FAR* FAR*);
                     40: 
                     41:     // IUnknown methods
                     42:     //
                     43:     STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppvObj);
                     44:     STDMETHOD_(unsigned long, AddRef)(void);
                     45:     STDMETHOD_(unsigned long, Release)(void);
                     46: 
                     47:     // Introduced methods
                     48:     //
                     49:     HRESULT Draw(void);
                     50:     HRESULT Dump(void);
                     51:     HRESULT Reset(void);
                     52:     HRESULT AddPoint(short x, short y);
                     53:     HRESULT EnumPoints(IEnumVARIANT FAR* FAR* ppenum);
                     54:     HRESULT GetXOrigin(short FAR* pxorg);
                     55:     HRESULT SetXOrigin(short xorg);
                     56:     HRESULT GetYOrigin(short FAR* pyorg);
                     57:     HRESULT SetYOrigin(short yorg);
                     58:     HRESULT GetWidth(short FAR* pwidth);
                     59:     HRESULT SetWidth(short width);
                     60: 
                     61:     HRESULT get_red(short FAR* psRed);
                     62:     HRESULT set_red(short sRed);
                     63:     HRESULT get_green(short FAR* psGreen);
                     64:     HRESULT set_green(short sGreen);
                     65:     HRESULT get_blue(short FAR* psBlue);
                     66:     HRESULT set_blue(short sBlue);
                     67: 
                     68: private:
                     69:     CRemPoly();
                     70: 
                     71:     HRESULT get_i2(DISPID dispid, short FAR* ps);
                     72:     HRESULT set_i2(DISPID dispid, short s);
                     73: 
                     74:     unsigned long m_refs;
                     75:     IDispatch FAR* m_pdisp;
                     76: 
                     77:     // NOTE: this enumeration exists simply to allow us to symbolicly
                     78:     // index the member name and id arrays (m_rgid and m_rgszMethods).
                     79:     // This doesn't (necessarrily) have any connection to the vtable
                     80:     // indices, it *only* needs to correspond correctly to the m_rgid
                     81:     // and m_rgszMethods arrays.
                     82:     //
                     83:     enum CREMPOLY_METHODS {
                     84:        IMETH_CREMPOLY_DRAW = 0,
                     85:        IMETH_CREMPOLY_DUMP,
                     86:        IMETH_CREMPOLY_RESET,
                     87:        IMETH_CREMPOLY_ADDPOINT,
                     88:        IMETH_CREMPOLY_ENUMPOINTS,
                     89:        IMETH_CREMPOLY_GETXORIGIN,
                     90:        IMETH_CREMPOLY_SETXORIGIN,
                     91:        IMETH_CREMPOLY_GETYORIGIN,
                     92:        IMETH_CREMPOLY_SETYORIGIN,
                     93:        IMETH_CREMPOLY_GETWIDTH,
                     94:        IMETH_CREMPOLY_SETWIDTH,
                     95:        IMETH_CREMPOLY_GETRED,
                     96:        IMETH_CREMPOLY_SETRED,
                     97:        IMETH_CREMPOLY_GETGREEN,
                     98:        IMETH_CREMPOLY_SETGREEN,
                     99:        IMETH_CREMPOLY_GETBLUE,
                    100:        IMETH_CREMPOLY_SETBLUE,
                    101:        IMETH_CREMPOLY_MAX
                    102:     };
                    103: 
                    104:     // member IDs - these are used by IDispatch::Invoke to identify the
                    105:     // method or property on the remote object we accessing.
                    106:     //
                    107:     DISPID m_rgdispid[IMETH_CREMPOLY_MAX];
                    108: 
                    109:     // member names - these are used to learn the member IDs when we
                    110:     // connect to the remote object.
                    111:     //
                    112:     static char FAR* m_rgszMethods[IMETH_CREMPOLY_MAX];
                    113: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.