Annotation of mstools/ole20/samples/spoly/cpoint.h, revision 1.1.1.1

1.1       root        1: /*** 
                      2: *cpoint.h
                      3: *
                      4: *  Copyright (C) 1992, Microsoft Corporation.  All Rights Reserved.
                      5: *  Information Contained Herein Is Proprietary and Confidential.
                      6: *
                      7: *Purpose:
                      8: *  Definition of the CPoint class.
                      9: *
                     10: *  The CPoint object exposes two properties for programatic access
                     11: *  via the IDispatch interface.
                     12: *
                     13: *  properties:
                     14: *    X                         - the 'x' coordinate of the point
                     15: *    Y                         - the 'y' coordinate of the point
                     16: *
                     17: *Implementation Notes:
                     18: *
                     19: *****************************************************************************/
                     20: 
                     21: #ifndef        CLASS
                     22: #ifdef __TURBOC__
                     23: #define CLASS class huge
                     24: #else
                     25: #define CLASS class FAR
                     26: #endif
                     27: #endif
                     28: 
                     29: class CPoly;
                     30: 
                     31: CLASS CPoint : public IDispatch {
                     32:     friend class CPoly;
                     33: 
                     34: public:
                     35:     static CPoint FAR* Create();
                     36: 
                     37:     /* IUnknown methods */
                     38:     STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppvObj);
                     39:     STDMETHOD_(unsigned long, AddRef)(void);
                     40:     STDMETHOD_(unsigned long, Release)(void);
                     41: 
                     42:     /* IDispatch methods */
                     43:     STDMETHOD(GetTypeInfoCount)(unsigned int FAR* pcTypeInfo);
                     44: 
                     45:     STDMETHOD(GetTypeInfo)(
                     46:       unsigned int iTypeInfo,
                     47:       LCID lcid,
                     48:       ITypeInfo FAR* FAR* ppTypeInfo);
                     49: 
                     50:     STDMETHOD(GetIDsOfNames)(
                     51:       REFIID riid,
                     52:       char FAR* FAR* rgszNames,
                     53:       unsigned int cNames,
                     54:       LCID lcid,
                     55:       DISPID FAR* rgdispid);
                     56: 
                     57:     STDMETHOD(Invoke)(
                     58:       DISPID dispidMember,
                     59:       REFIID riid,
                     60:       LCID lcid,
                     61:       unsigned short wFlags,
                     62:       DISPPARAMS FAR* pdispparams,
                     63:       VARIANT FAR* pvarResult,
                     64:       EXCEPINFO FAR* pexcepinfo,
                     65:       unsigned int FAR* pwArgErr);
                     66: 
                     67:     /* Introduced methods */
                     68: 
                     69:     virtual short PASCAL GetX(void);
                     70:     virtual void  PASCAL SetX(short x);
                     71:     virtual short PASCAL GetY(void);
                     72:     virtual void  PASCAL SetY(short y);
                     73: 
                     74: private:
                     75:     CPoint();
                     76: 
                     77:     unsigned long m_refs;
                     78: 
                     79:     short m_x;
                     80:     short m_y;
                     81: };
                     82: 
                     83: 
                     84: // member DISPIDs
                     85: //
                     86: enum IDMEMBER_CPOINT {
                     87:     IDMEMBER_CPOINT_GETX = 1,
                     88:     IDMEMBER_CPOINT_SETX,
                     89:     IDMEMBER_CPOINT_GETY,
                     90:     IDMEMBER_CPOINT_SETY,
                     91:     IDMEMBER_CPOINT_MAX
                     92: };
                     93: 
                     94: // structure used to link together lists of points
                     95: //
                     96: struct POINTLINK {
                     97:     POINTLINK FAR* next;
                     98:     CPoint FAR* ppoint;
                     99: };
                    100: 
                    101: 
                    102: // The CPoint Class Factory
                    103: //
                    104: CLASS CPointCF : public IClassFactory
                    105: {
                    106: public:
                    107:     static IClassFactory FAR* Create();
                    108: 
                    109:     /* IUnknown methods */
                    110:     STDMETHOD(QueryInterface)(REFIID iid, void FAR* FAR* ppv);
                    111:     STDMETHOD_(unsigned long, AddRef)(void);
                    112:     STDMETHOD_(unsigned long, Release)(void);
                    113: 
                    114:     /* IClassFactory methods */
                    115:     STDMETHOD(CreateInstance)(
                    116:       IUnknown FAR* pUnkOuter, REFIID iid, void FAR* FAR* ppv);
                    117: #ifdef _MAC
                    118:     STDMETHOD(LockServer)(unsigned long fLock);
                    119: #else
                    120:     STDMETHOD(LockServer)(BOOL fLock);
                    121: #endif
                    122: 
                    123: private:
                    124:     CPointCF();
                    125: 
                    126:     unsigned long m_refs;
                    127: };

unix.superglobalmegacorp.com

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