|
|
1.1 root 1: /***
2: *idata.cpp
3: *
4: * Copyright (C) 1992, Microsoft Corporation. All Rights Reserved.
5: * Information Contained Herein Is Proprietary and Confidential.
6: *
7: *Purpose:
8: * This file contains the INTERFACEDATA definitions for the methods
9: * and properties on the CCalc object that are exposed for external
10: * programmability via IDispatch.
11: *
12: *
13: *Implementation Notes:
14: *
15: *****************************************************************************/
16:
17: #include <windows.h>
18: #include <ole2.h>
19: #if !defined(WIN32)
20: #include <olenls.h>
21: #endif
22: #include <dispatch.h>
23:
24: #include "dispcalc.h"
25:
26:
27: //---------------------------------------------------------------------
28: // INTERFACEDATA definitions
29: //---------------------------------------------------------------------
30:
31: /* The INTERFACEDATA table describes the methods and properties that
32: * are being exposed for external programmability via IDispatch.
33: * This table is used to construct a CDispTypeInfo for this interface,
34: * and that TypeInfo is in turn used to initialize and drive the
35: * default implementation of IDispatch.
36: */
37:
38:
39: // PDATA1() declares the PARAMDATA for a methods that takes a single param
40: //
41: #define PDATA1(NAME, TYPE) \
42: static PARAMDATA NEAR rgpdata ## NAME = {#NAME, TYPE}
43:
44: // MDATA() declares a single METHODDATA entry
45: //
46: #define MDATA(NAME, PDATA, IDMEMBER, IMETH, CARGS, KIND, TYPE) \
47: { #NAME, PDATA, IDMEMBER, IMETH, CC_CDECL, CARGS, KIND, TYPE }
48:
49: // The following macro defines the METHODDATA entries for a
50: // property Put/Get method pair.
51: //
52: // Note: this macro *assumes* that the Put/Get pair are adjacent
53: // in the vtable, and that the Put method comes first.
54: //
55: #define PROPERTY(NAME, IMETH, ID, TYPE) \
56: MDATA(NAME, &rgpdata ## NAME, ID, IMETH, 1,DISPATCH_PROPERTYPUT,VT_EMPTY), \
57: MDATA(NAME, NULL, ID, IMETH+1, 0, DISPATCH_PROPERTYGET, TYPE)
58:
59: // The following macro is used to define a METHODDATA entry for
60: // a method that takes zero parameters.
61: //
62: #define METHOD0(NAME, IMETH, ID, TYPE) \
63: MDATA(NAME, NULL, ID, IMETH, 0, DISPATCH_METHOD, TYPE)
64:
65: // and for one param
66: #define METHOD1(NAME, IMETH, ID, TYPE) \
67: MDATA(NAME, &rgpdata ## NAME, ID, IMETH, 1, DISPATCH_METHOD, TYPE)
68:
69:
70: PDATA1(VALUE, VT_I4);
71: PDATA1(ACCUM, VT_I4);
72: PDATA1(OPND, VT_I4);
73: PDATA1(OP, VT_I2);
74: PDATA1(BUTTON, VT_BSTR);
75:
76: static METHODDATA NEAR rgmdataCCalc[] =
77: {
78: PROPERTY(VALUE, IMETH_ACCUM, IDMEMBER_ACCUM, VT_I4)
79: , PROPERTY(ACCUM, IMETH_ACCUM, IDMEMBER_ACCUM, VT_I4)
80: , PROPERTY(OPND, IMETH_OPERAND, IDMEMBER_OPERAND, VT_I4)
81: , PROPERTY(OP, IMETH_OPERATOR, IDMEMBER_OPERATOR, VT_I2)
82: , METHOD0(EVAL, IMETH_EVAL, IDMEMBER_EVAL, VT_BOOL)
83: , METHOD0(CLEAR, IMETH_CLEAR, IDMEMBER_CLEAR, VT_EMPTY)
84: , METHOD0(DISPLAY, IMETH_DISPLAY, IDMEMBER_DISPLAY, VT_EMPTY)
85: , METHOD0(QUIT, IMETH_QUIT, IDMEMBER_QUIT, VT_EMPTY)
86: , METHOD1(BUTTON, IMETH_BUTTON, IDMEMBER_BUTTON, VT_BOOL)
87: };
88:
89: INTERFACEDATA NEAR g_idataCCalc =
90: {
91: rgmdataCCalc, DIM(rgmdataCCalc)
92: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.