Windows NT 4.0 source code leak
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.

85 lines
2.9 KiB

4 years ago
  1. /***
  2. *idata.cpp
  3. *
  4. * Copyright (C) 1992-1994, 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. #include "dispcalc.h"
  17. //---------------------------------------------------------------------
  18. // INTERFACEDATA definitions
  19. //---------------------------------------------------------------------
  20. /* The INTERFACEDATA table describes the methods and properties that
  21. * are being exposed for external programmability via IDispatch.
  22. * This table is used to construct a CDispTypeInfo for this interface,
  23. * and that TypeInfo is in turn used to initialize and drive the
  24. * default implementation of IDispatch.
  25. */
  26. // PDATA1() declares the PARAMDATA for a methods that takes a single param
  27. //
  28. #define PDATA1(NAME, TYPE) \
  29. static PARAMDATA NEARDATA rgpdata ## NAME = {OLESTR(#NAME), TYPE}
  30. // MDATA() declares a single METHODDATA entry
  31. //
  32. #define MDATA(NAME, PDATA, IDMEMBER, IMETH, CARGS, KIND, TYPE) \
  33. { OLESTR(#NAME), PDATA, IDMEMBER, IMETH, CC_CDECL, CARGS, KIND, TYPE }
  34. // The following macro defines the METHODDATA entries for a
  35. // property Put/Get method pair.
  36. //
  37. // Note: this macro *assumes* that the Put/Get pair are adjacent
  38. // in the vtable, and that the Put method comes first.
  39. //
  40. #define PROPERTY(NAME, IMETH, ID, TYPE) \
  41. MDATA(NAME, &rgpdata ## NAME, ID, IMETH, 1,DISPATCH_PROPERTYPUT,VT_EMPTY), \
  42. MDATA(NAME, NULL, ID, IMETH+1, 0, DISPATCH_PROPERTYGET, TYPE)
  43. // The following macro is used to define a METHODDATA entry for
  44. // a method that takes zero parameters.
  45. //
  46. #define METHOD0(NAME, IMETH, ID, TYPE) \
  47. MDATA(NAME, NULL, ID, IMETH, 0, DISPATCH_METHOD, TYPE)
  48. // and for one param
  49. #define METHOD1(NAME, IMETH, ID, TYPE) \
  50. MDATA(NAME, &rgpdata ## NAME, ID, IMETH, 1, DISPATCH_METHOD, TYPE)
  51. PDATA1(VALUE, VT_I4);
  52. PDATA1(ACCUM, VT_I4);
  53. PDATA1(OPND, VT_I4);
  54. PDATA1(OP, VT_I2);
  55. PDATA1(BUTTON, VT_BSTR);
  56. static METHODDATA NEARDATA rgmdataCCalc[] =
  57. {
  58. PROPERTY(VALUE, IMETH_ACCUM, IDMEMBER_ACCUM, VT_I4)
  59. , PROPERTY(ACCUM, IMETH_ACCUM, IDMEMBER_ACCUM, VT_I4)
  60. , PROPERTY(OPND, IMETH_OPERAND, IDMEMBER_OPERAND, VT_I4)
  61. , PROPERTY(OP, IMETH_OPERATOR, IDMEMBER_OPERATOR, VT_I2)
  62. , METHOD0(EVAL, IMETH_EVAL, IDMEMBER_EVAL, VT_BOOL)
  63. , METHOD0(CLEAR, IMETH_CLEAR, IDMEMBER_CLEAR, VT_EMPTY)
  64. , METHOD0(DISPLAY, IMETH_DISPLAY, IDMEMBER_DISPLAY, VT_EMPTY)
  65. , METHOD0(QUIT, IMETH_QUIT, IDMEMBER_QUIT, VT_EMPTY)
  66. , METHOD1(BUTTON, IMETH_BUTTON, IDMEMBER_BUTTON, VT_BOOL)
  67. };
  68. INTERFACEDATA NEARDATA g_idataCCalc =
  69. {
  70. rgmdataCCalc, DIM(rgmdataCCalc)
  71. };