CARD.ODL
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:5k
源码类别:

Windows编程

开发平台:

Visual C++

  1. //=--------------------------------------------------------------------------=
  2. // Card.ODL
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995 - 1997 Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // ODL file for the control(s) and automation object(s) in this inproc server
  13. //
  14. #include <olectl.h>
  15. #include "dispids.h"
  16. // can't include oaidl.h, so this will have to do
  17. //
  18. #define DISPID_NEWENUM -4
  19. //#define VARIANT_BOOL short
  20. //=--------------------------------------------------------------------------=
  21. // the libid for this type libray
  22. //
  23. [
  24.     uuid(55707B20-FF82-11cf-BB32-142A04C10000),
  25.     helpstring("ActiveX SDK Card Control Library"),
  26.     lcid(0x0000),
  27.     version(1.0)
  28. ]
  29. library CardObjects {
  30.     // standard imports
  31.     //
  32.     importlib("STDOLE2.TLB");
  33.     importlib(STDTYPE_TLB);
  34.     typedef enum {
  35. [helpstring("TopLeft")]    CardTopLeft = 0,
  36. [helpstring("TopCenter")]    CardTopCenter = 1,
  37. [helpstring("TopRight")]   CardTopRight = 2,
  38. [helpstring("CenterLeft")]    CardCenterLeft = 3,
  39. [helpstring("Center")]    CardCenter = 4,
  40. [helpstring("CenterRight")]   CardCenterRight = 5,
  41. [helpstring("BottomLeft")]   CardBottomLeft = 6,
  42. [helpstring("BottomCenter")]    CardBottomCenter = 7,
  43. [helpstring("BottomRight")]   CardBottomRight = 8,
  44. [helpstring("Stretch")]   CardStretch = 9
  45.     } enumCardAlignment;
  46.     typedef enum {
  47. [helpstring("Ace")]    CardAce = 1,
  48. [helpstring("Two")]   Card2 = 2,
  49. [helpstring("Three")]   Card3 = 3,
  50. [helpstring("Four")]   Card4 = 4,
  51. [helpstring("Five")]   Card5 = 5,
  52. [helpstring("Six")]   Card6 = 6,
  53. [helpstring("Seven")]   Card7 = 7,
  54. [helpstring("Eight")]   Card8 = 8,
  55. [helpstring("Nine")]   Card9 = 9,
  56. [helpstring("Ten")]   Card10 = 10,
  57. [helpstring("Jack")]   CardJack = 11,
  58. [helpstring("Queen")]   CardQueen = 12,
  59. [helpstring("King")]   CardKing = 13,
  60. [helpstring("Joker")]   CardJoker = 14
  61.     } enumCardNumber;
  62.     typedef enum {
  63. [helpstring("Invisible")] CardBlank = 0,
  64. [helpstring("Clubs")] CardClub = 1,
  65. [helpstring("Spades")] CardSpade = 2,
  66. [helpstring("Hearts")] CardHeart = 3,
  67. [helpstring("Diamonds")] CardDiamond = 4,
  68. [helpstring("CardBack Weave1")] CardBack1 = -1,
  69. [helpstring("CardBack Weave2")] CardBack2 = -2,
  70. [helpstring("CardBack Robot")] CardBack3 = -3,
  71. [helpstring("CardBack Roses")] CardBack4 = -4,
  72. [helpstring("CardBack BlackVine")] CardBack5 = -5,
  73. [helpstring("CardBack BlueVine")] CardBack6 = -6,
  74. [helpstring("CardBack Fish1")] CardBack7 = -7,
  75. [helpstring("CardBack Fish2")] CardBack8 = -8,
  76. [helpstring("CardBack Seashell")] CardBack9 = -9,
  77. [helpstring("CardBack Castle")] CardBack10 = -10,
  78. [helpstring("CardBack Beach")] CardBack11 = -11,
  79. [helpstring("CardBack Hand")] CardBack12 = -12,
  80. [helpstring("CardBack Casino")] CardBack13 = -13
  81.     } enumCardSuite;
  82.     // primary dispatch interface for CCard control
  83.     //
  84.     [
  85. uuid(55707B21-FF82-11cf-BB32-142A04C10000),
  86.                 helpstring("ActiveX SDK Card Control"),
  87.         hidden,
  88. dual,
  89. odl
  90.     ]
  91.     interface ICard : IDispatch {
  92. // properties
  93. //
  94. [id(DISPID_NUMBER), propget]
  95.             HRESULT Number([out, retval] enumCardNumber *number);
  96.         [id(DISPID_NUMBER), propput]
  97.             HRESULT Number([in] enumCardNumber number);
  98. [id(DISPID_SUITE), propget]
  99.             HRESULT Suite([out, retval] enumCardSuite *suite);
  100.         [id(DISPID_SUITE), propput]
  101.             HRESULT Suite([in] enumCardSuite suite);
  102. [id(DISPID_INVERT), propget]
  103.             HRESULT Invert([out, retval] Boolean *invert);
  104.         [id(DISPID_INVERT), propput]
  105.             HRESULT Invert([in] Boolean invert);
  106. [id(DISPID_CARDALIGNMENT), propget]
  107.             HRESULT CardAlignment([out, retval] enumCardAlignment *cardalignment);
  108.         [id(DISPID_CARDALIGNMENT), propput]
  109.             HRESULT CardAlignment([in] enumCardAlignment cardalignment);
  110.         // methods
  111. //
  112.         [id(DISPID_ABOUTBOX)]
  113.             void AboutBox(void);
  114.     };
  115.     // event interface for CCard controls ...
  116.     //
  117.     [
  118. uuid(55707B22-FF82-11cf-BB32-142A04C10000),
  119.                helpstring("Event interface for ActiveX SDK Card control"),
  120. hidden
  121.     ]
  122.     dispinterface DCardEvents {
  123.         
  124. properties:
  125. methods:
  126. [id(DISPID_MOUSEMOVE)] void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  127. [id(DISPID_CLICK)] void Click();
  128. [id(DISPID_DBLCLICK)] void DblClick();
  129. [id(DISPID_MOUSEDOWN)] void MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  130. [id(DISPID_MOUSEUP)] void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  131.     };
  132.     // coclass for Card controls
  133.     //
  134.     [
  135. uuid(55707B23-FF82-11cf-BB32-142A04C10000),
  136.                 helpstring("ActiveX SDK Card control")
  137.     ]
  138.     coclass Card {
  139.         [default]         interface ICard;
  140.                 [default, source] dispinterface DCardEvents;
  141.     };
  142. };