home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / VBAPI.H_ / VBAPI.bin
Encoding:
Text File  |  1993-02-14  |  31.6 KB  |  885 lines

  1. #ifdef __cplusplus 
  2. extern "C" { 
  3. #endif 
  4. //---------------------------------------------------------------------------
  5. //
  6. //  VBAPI.H -
  7. //    Copyright (c) 1991-1992, Microsoft Corp.  All Rights Reserved.
  8. //
  9. //    Include file for the Visual Basic Custom Control and DLL
  10. //    application programming interface.
  11. //
  12. //---------------------------------------------------------------------------
  13.  
  14. #define VB100_VERSION    0x0100
  15. #define VB200_VERSION    0x0200
  16. #define VB_VERSION    VB200_VERSION
  17.  
  18. #define VBAPI FAR PASCAL
  19.  
  20. //---------------------------------------------------------------------------
  21. // General types and modifiers
  22. //---------------------------------------------------------------------------
  23.  
  24. #define FP    FAR  *
  25. typedef   signed short    SHORT;        // ad lib
  26. typedef unsigned short    USHORT;     // ad lib
  27. typedef unsigned int    FSHORT;     // fs
  28. typedef   signed char    CHAR;        // ch
  29. typedef unsigned char    ENUM;        // enum
  30. typedef unsigned long    ULONG;        // ul
  31. typedef unsigned long    FLONG;        // fl
  32. typedef SHORT    FP LPSHORT;
  33. typedef USHORT          IPROP;          // iprop
  34. typedef HANDLE        HFORMFILE;    // hformfile
  35. typedef USHORT        ERR;        // err
  36. typedef WORD        HPIC;        // hpic
  37. typedef LPSTR        HSZ;        // hsz
  38. typedef LPVOID        HLSTR;        // hlstr
  39. typedef LPVOID        HAD;        // hAD - handle to Basic array desc.
  40. typedef LPVOID        HCTL;        // hctl
  41. typedef LONG (FAR PASCAL * PFNWP)(HWND hwnd, USHORT msg, WORD wp, LONG lp);          // pfnwp
  42. typedef LONG (FAR PASCAL * PCTLPROC)(HCTL hctl, HWND hwnd, USHORT msg, USHORT wp, LONG lp); // pctlproc
  43.  
  44. //---------------------------------------------------------------------------
  45. // language Variant structures
  46. //---------------------------------------------------------------------------
  47.  
  48. typedef struct
  49. {
  50.     LONG    lo;
  51.     LONG    hi;
  52. } CURRENCY;
  53.  
  54. typedef union
  55. {
  56.     SHORT    i2;
  57.     LONG    i4;
  58.     float    r4;
  59.     double    r8;
  60.     CURRENCY cy;
  61.     HLSTR    hlstr;
  62. } VALUE;
  63.  
  64. typedef VALUE far *    LPVAL;
  65.  
  66. // The size of Variant is needed when a Variant is passed by value
  67. // or in a structure (user-defined type).
  68.  
  69. typedef struct
  70. {
  71.     char v[16];
  72. } VARIANT;
  73.  
  74. typedef VARIANT FAR *LPVAR;
  75.  
  76. // variant type constants. these are the return value of GetVariantType.
  77. // these are also defined in Constant.Txt for return value of VarType()
  78.  
  79. #define VT_EMPTY    0    // Empty
  80. #define VT_NULL     1    // Null
  81. #define VT_I2        2    // Integer
  82. #define VT_I4        3    // Long
  83. #define VT_R4        4    // Single
  84. #define VT_R8        5    // Double
  85. #define VT_CURRENCY 6    // Currency
  86. #define VT_DATE     7    // Date
  87. #define VT_STRING   8    // String
  88.  
  89. //---------------------------------------------------------------------------
  90. // COLOR - a Windows RGB DWORD value.
  91. //---------------------------------------------------------------------------
  92. typedef unsigned long    COLOR;
  93. typedef COLOR FAR *    LPCOLOR;    // lpcolor
  94.  
  95. #define COLOR_DEFBITON    0x80000000    // bit set -> Win SysColor, not RGB
  96.  
  97. // Get RGB value from a color.
  98. #define RGBCOLOR(clr) \
  99.   (((clr)&COLOR_DEFBITON)?(GetSysColor((int)((clr)&0xFFFF))):((clr)&0xFFFFFF))
  100.  
  101.  
  102. //---------------------------------------------------------------------------
  103. // Property data structure
  104. //---------------------------------------------------------------------------
  105. typedef struct tagDATASTRUCT
  106. {
  107.     LONG   data;        // Data for Get/Set
  108.     USHORT cindex;        // Number of indecies
  109.     struct
  110.     {
  111.     USHORT datatype;    // Type of nth index (Currently always DT_SHORT)
  112.     LONG   data;        // Value of nth index
  113.     } index[1];         // Currently, only 1-dim arrays supported
  114. } DATASTRUCT;
  115.  
  116. typedef DATASTRUCT FAR    *LPDATASTRUCT;    // pds
  117. typedef DATASTRUCT NEAR *NPDATASTRUCT;    // npds
  118.  
  119.  
  120. //---------------------------------------------------------------------------
  121. // VISUAL BASIC variable types
  122. //---------------------------------------------------------------------------
  123. #define ET_I2        1   // 16 bit signed integer scalar or array variable
  124. #define ET_I4        2   // 32 bit signed integer scalar or array variable
  125. #define ET_R4        3
  126. #define ET_R8        4   // 64 bit real scalar or array variable
  127. #define ET_CY        5   // 64 bit currency scalar or array variable
  128. #define ET_HLSTR    6   // string scalar or array variable
  129. #define ET_SD        6   // older, unpreferred equivalent to ET_HLSTR
  130. #define ET_FS        7   // fixed-length string variable
  131.  
  132. //---------------------------------------------------------------------------
  133. // Control Property definitions and structures.
  134. //---------------------------------------------------------------------------
  135.  
  136. #define PF_datatype        0x000000FFL
  137. #define PF_fPropArray        0x00000100L
  138. #define PF_fSetData        0x00000200L
  139. #define PF_fSetMsg        0x00000400L
  140. #define PF_fNoShow        0x00000800L
  141. #define PF_fNoRuntimeW        0x00001000L
  142. #define PF_fGetData        0x00002000L
  143. #define PF_fGetMsg        0x00004000L
  144. #define PF_fSetCheck        0x00008000L
  145. #define PF_fSaveData        0x00010000L
  146. #define PF_fSaveMsg        0x00020000L
  147. #define PF_fLoadDataOnly    0x20010000L
  148. #define PF_fLoadMsgOnly     0x20020000L
  149. #define PF_fGetHszMsg        0x00040000L
  150. #define PF_fUpdateOnEdit    0x00080000L
  151. #define PF_fEditable        0x00100000L
  152. #define PF_fPreHwnd        0x00200000L
  153. #define PF_fDefVal        0x00400000L
  154. #define PF_fNoInitDef        0x00800000L
  155. #define PF_fNoRuntimeR        0x02000000L
  156. #define PF_fNoMultiSelect   0x04000000L
  157.  
  158. typedef struct tagPROPINFO
  159.   {
  160.   PSTR    npszName;
  161.   FLONG    fl;            // PF_ flags
  162.   BYTE    offsetData;        // Offset into static structure
  163.   BYTE    infoData;        // 0 or _INFO value for bitfield
  164.   LONG    dataDefault;        // 0 or _INFO value for bitfield
  165.   PSTR    npszEnumList;        // For type == DT_ENUM, this is
  166.                 // a near ptr to a string containing
  167.                 // all the values to be displayed
  168.                 // in the popup enumeration listbox.
  169.                 // Each value is an sz, with an
  170.                 // empty sz indicated the end of list.
  171.   BYTE    enumMax;        // Maximum legal value for enum.
  172.   } PROPINFO;
  173.  
  174. typedef PROPINFO  FAR  * LPPROPINFO;
  175. typedef PROPINFO  NEAR * NPPROPINFO;
  176. typedef PROPINFO  NEAR *  PPROPINFO;
  177. typedef PPROPINFO FAR  * LPPROPLIST;
  178. typedef PPROPINFO NEAR * NPPROPLIST;
  179. typedef PPROPINFO NEAR *  PPROPLIST;
  180.  
  181. // Values for PROP PF_datatype
  182.  
  183. #define DT_HSZ          0x01
  184. #define DT_SHORT      0x02
  185. #define DT_LONG       0x03
  186. #define DT_BOOL       0x04
  187. #define DT_COLOR      0x05
  188. #define DT_ENUM       0x06
  189. #define DT_REAL       0x07
  190. #define DT_XPOS       0x08    // Scaled from float to long twips
  191. #define DT_XSIZE      0x09    //   _SIZE scales without origin
  192. #define DT_YPOS       0x0A    //   _POS subtracts origin
  193. #define DT_YSIZE      0x0B    // uses parent's scale properties
  194. #define DT_PICTURE    0x0C
  195. #define DT_HLSTR      0x0D
  196. #if VTOBJS
  197. #define DT_DATETIME   0x0E
  198. #define DT_DOUBLE     0x0F
  199. #define DT_CURRENCY   0x10
  200. #define DT_NULL       0x11
  201. #define DT_HSZMEMO    0x12
  202. #define DT_VTCOLL     0x70        /* VT Object collections    */
  203. #endif
  204.  
  205. //---------------------------------------------------------------------------
  206. // Control event definitions and structures.
  207. //---------------------------------------------------------------------------
  208.  
  209. #define EF_fNoUnload    0x00000001L
  210.  
  211. typedef struct tagEVENTINFO
  212.   {
  213.   PSTR        npszName;    // event procedure name suffix
  214.   USHORT    cParms;     // number of parameters
  215.   USHORT    cwParms;    // # words of parameters
  216.   PWORD        npParmTypes;    // list of parameter types
  217.   PSTR        npszParmProf;    // event parameter profile string
  218.   FLONG        fl;        // EF_ flags
  219.   } EVENTINFO;
  220.  
  221. typedef EVENTINFO   NEAR * PEVENTINFO;
  222. typedef PEVENTINFO  NEAR * PPEVENTINFO;
  223. typedef EVENTINFO   NEAR * NPEVENTINFO;
  224. typedef EVENTINFO   FAR  * LPEVENTINFO;
  225. typedef NPEVENTINFO FAR  * LPEVENTLIST;
  226. typedef NPEVENTINFO NEAR * NPEVENTLIST;
  227.  
  228. //---------------------------------------------------------------------------
  229. // Standard control event list
  230. //---------------------------------------------------------------------------
  231.  
  232. #define IEVENT_STD_CLICK    0x0000
  233. #define IEVENT_STD_DBLCLICK    0x0001
  234. #define IEVENT_STD_DRAGDROP    0x0002
  235. #define IEVENT_STD_DRAGOVER    0x0003
  236. #define IEVENT_STD_GOTFOCUS    0x0004
  237. #define IEVENT_STD_KEYDOWN    0x0005
  238. #define IEVENT_STD_KEYPRESS    0x0006
  239. #define IEVENT_STD_KEYUP    0x0007
  240. #define IEVENT_STD_LOSTFOCUS    0x0008
  241. #define IEVENT_STD_MOUSEDOWN    0x0009
  242. #define IEVENT_STD_MOUSEMOVE    0x000A
  243. #define IEVENT_STD_MOUSEUP    0x000B
  244. #define IEVENT_STD_LINKERROR    0x000C
  245. #define IEVENT_STD_LINKOPEN     0x000D
  246. #define IEVENT_STD_LINKCLOSE    0x000E
  247. #define IEVENT_STD_LINKNOTIFY   0x000F
  248. #define IEVENT_STD_LINKCHANGE   0x0010
  249. #define IEVENT_STD_NONE     0x0FFF
  250. #define IEVENT_STD_LAST     0x0FFF
  251.  
  252. #define PEVENTINFO_STD_CLICK        ((PEVENTINFO)~IEVENT_STD_CLICK)
  253. #define PEVENTINFO_STD_DBLCLICK     ((PEVENTINFO)~IEVENT_STD_DBLCLICK)
  254. #define PEVENTINFO_STD_DRAGDROP     ((PEVENTINFO)~IEVENT_STD_DRAGDROP)
  255. #define PEVENTINFO_STD_DRAGOVER     ((PEVENTINFO)~IEVENT_STD_DRAGOVER)
  256. #define PEVENTINFO_STD_GOTFOCUS     ((PEVENTINFO)~IEVENT_STD_GOTFOCUS)
  257. #define PEVENTINFO_STD_KEYDOWN        ((PEVENTINFO)~IEVENT_STD_KEYDOWN)
  258. #define PEVENTINFO_STD_KEYPRESS     ((PEVENTINFO)~IEVENT_STD_KEYPRESS)
  259. #define PEVENTINFO_STD_KEYUP        ((PEVENTINFO)~IEVENT_STD_KEYUP)
  260. #define PEVENTINFO_STD_LOSTFOCUS    ((PEVENTINFO)~IEVENT_STD_LOSTFOCUS)
  261. #define PEVENTINFO_STD_MOUSEDOWN    ((PEVENTINFO)~IEVENT_STD_MOUSEDOWN)
  262. #define PEVENTINFO_STD_MOUSEMOVE    ((PEVENTINFO)~IEVENT_STD_MOUSEMOVE)
  263. #define PEVENTINFO_STD_MOUSEUP        ((PEVENTINFO)~IEVENT_STD_MOUSEUP)
  264. #define PEVENTINFO_STD_LINKERROR    ((PEVENTINFO)~IEVENT_STD_LINKERROR)
  265. #define PEVENTINFO_STD_LINKOPEN     ((PEVENTINFO)~IEVENT_STD_LINKOPEN)
  266. #define PEVENTINFO_STD_LINKCLOSE    ((PEVENTINFO)~IEVENT_STD_LINKCLOSE)
  267. #define PEVENTINFO_STD_LINKNOTIFY   ((PEVENTINFO)~IEVENT_STD_LINKNOTIFY)
  268. #define PEVENTINFO_STD_LINKCHANGE   ((PEVENTINFO)~IEVENT_STD_LINKCHANGE)
  269. #define PEVENTINFO_STD_NONE        ((PEVENTINFO)~IEVENT_STD_NONE)
  270. #define PEVENTINFO_STD_LAST        ((PEVENTINFO)~IEVENT_STD_LAST)
  271.  
  272.  
  273. //---------------------------------------------------------------------------
  274. // Standard control properties
  275. //---------------------------------------------------------------------------
  276.  
  277. #define IPROP_STD_NAME            0x0000
  278. #define IPROP_STD_CTLNAME        IPROP_STD_NAME
  279. #define IPROP_STD_INDEX         0x0001
  280. #define IPROP_STD_HWND            0x0002
  281. #define IPROP_STD_BACKCOLOR        0x0003
  282. #define IPROP_STD_FORECOLOR        0x0004
  283. #define IPROP_STD_LEFT            0x0005
  284. #define IPROP_STD_TOP            0x0006
  285. #define IPROP_STD_WIDTH         0x0007
  286. #define IPROP_STD_HEIGHT        0x0008
  287. #define IPROP_STD_ENABLED        0x0009
  288. #define IPROP_STD_VISIBLE        0x000A
  289. #define IPROP_STD_MOUSEPOINTER        0x000B
  290. #define IPROP_STD_CAPTION        0x000C
  291. #define IPROP_STD_FONTNAME        0x000D
  292. #define IPROP_STD_FONTBOLD        0x000E
  293. #define IPROP_STD_FONTITALIC        0x000F
  294. #define IPROP_STD_FONTSTRIKE        0x0010
  295. #define IPROP_STD_FONTUNDER        0x0011
  296. #define IPROP_STD_FONTSIZE        0x0012
  297. #define IPROP_STD_TABINDEX        0x0013
  298. #define IPROP_STD_PARENT        0x0014
  299. #define IPROP_STD_DRAGMODE        0x0015
  300. #define IPROP_STD_DRAGICON        0x0016
  301. #define IPROP_STD_BORDERSTYLEOFF    0x0017
  302. #define IPROP_STD_TABSTOP        0x0018
  303. #define IPROP_STD_TAG            0x0019
  304. #define IPROP_STD_TEXT            0x001B
  305. #define IPROP_STD_BORDERSTYLEON     0x001C
  306. #define IPROP_STD_CLIPCONTROLS        0x001D
  307. #define IPROP_STD_NONE            0x001E
  308. #define IPROP_STD_HELPCONTEXTID     0x001F
  309. #define IPROP_STD_LINKMODE        0x0020
  310. #define IPROP_STD_LINKITEM        0x0021
  311. #define IPROP_STD_LINKTOPIC        0x0022
  312. #define IPROP_STD_LINKTIMEOUT        0x0023
  313. #define IPROP_STD_LEFTNORUN        0x0024
  314. #define IPROP_STD_TOPNORUN        0x0025
  315. #define IPROP_STD_ALIGN         0x0026
  316. #define IPROP_STD_IMEMODE        0x0027    // FK_IME
  317. #define IPROP_STD_LAST            0x0FFF
  318.  
  319. #define PPROPINFO_STD_NAME        ((PPROPINFO)~IPROP_STD_NAME)
  320. #define PPROPINFO_STD_CTLNAME        ((PPROPINFO)~IPROP_STD_NAME)
  321. #define PPROPINFO_STD_INDEX        ((PPROPINFO)~IPROP_STD_INDEX)
  322. #define PPROPINFO_STD_HWND        ((PPROPINFO)~IPROP_STD_HWND)
  323. #define PPROPINFO_STD_BACKCOLOR     ((PPROPINFO)~IPROP_STD_BACKCOLOR)
  324. #define PPROPINFO_STD_FORECOLOR     ((PPROPINFO)~IPROP_STD_FORECOLOR)
  325. #define PPROPINFO_STD_LEFT        ((PPROPINFO)~IPROP_STD_LEFT)
  326. #define PPROPINFO_STD_TOP        ((PPROPINFO)~IPROP_STD_TOP)
  327. #define PPROPINFO_STD_WIDTH        ((PPROPINFO)~IPROP_STD_WIDTH)
  328. #define PPROPINFO_STD_HEIGHT        ((PPROPINFO)~IPROP_STD_HEIGHT)
  329. #define PPROPINFO_STD_ENABLED        ((PPROPINFO)~IPROP_STD_ENABLED)
  330. #define PPROPINFO_STD_VISIBLE        ((PPROPINFO)~IPROP_STD_VISIBLE)
  331. #define PPROPINFO_STD_MOUSEPOINTER  ((PPROPINFO)~IPROP_STD_MOUSEPOINTER)
  332. #define PPROPINFO_STD_CAPTION        ((PPROPINFO)~IPROP_STD_CAPTION)
  333. #define PPROPINFO_STD_FONTNAME        ((PPROPINFO)~IPROP_STD_FONTNAME)
  334. #define PPROPINFO_STD_FONTBOLD        ((PPROPINFO)~IPROP_STD_FONTBOLD)
  335. #define PPROPINFO_STD_FONTITALIC    ((PPROPINFO)~IPROP_STD_FONTITALIC)
  336. #define PPROPINFO_STD_FONTSTRIKE    ((PPROPINFO)~IPROP_STD_FONTSTRIKE)
  337. #define PPROPINFO_STD_FONTUNDER     ((PPROPINFO)~IPROP_STD_FONTUNDER)
  338. #define PPROPINFO_STD_FONTSIZE        ((PPROPINFO)~IPROP_STD_FONTSIZE)
  339. #define PPROPINFO_STD_TABINDEX        ((PPROPINFO)~IPROP_STD_TABINDEX)
  340. #define PPROPINFO_STD_PARENT        ((PPROPINFO)~IPROP_STD_PARENT)
  341. #define PPROPINFO_STD_DRAGMODE        ((PPROPINFO)~IPROP_STD_DRAGMODE)
  342. #define PPROPINFO_STD_DRAGICON        ((PPROPINFO)~IPROP_STD_DRAGICON)
  343. #define PPROPINFO_STD_BORDERSTYLEOFF ((PPROPINFO)~IPROP_STD_BORDERSTYLEOFF)
  344. #define PPROPINFO_STD_TABSTOP        ((PPROPINFO)~IPROP_STD_TABSTOP)
  345. #define PPROPINFO_STD_TAG        ((PPROPINFO)~IPROP_STD_TAG)
  346. #define PPROPINFO_STD_TEXT        ((PPROPINFO)~IPROP_STD_TEXT)
  347. #define PPROPINFO_STD_BORDERSTYLEON ((PPROPINFO)~IPROP_STD_BORDERSTYLEON)
  348. #define PPROPINFO_STD_CLIPCONTROLS  ((PPROPINFO)~IPROP_STD_CLIPCONTROLS)
  349. #define PPROPINFO_STD_NONE        ((PPROPINFO)~IPROP_STD_NONE)
  350. #define PPROPINFO_STD_HELPCONTEXTID ((PPROPINFO)~IPROP_STD_HELPCONTEXTID)
  351. #define PPROPINFO_STD_LINKMODE        ((PPROPINFO)~IPROP_STD_LINKMODE)
  352. #define PPROPINFO_STD_LINKITEM        ((PPROPINFO)~IPROP_STD_LINKITEM)
  353. #define PPROPINFO_STD_LINKTOPIC     ((PPROPINFO)~IPROP_STD_LINKTOPIC)
  354. #define PPROPINFO_STD_LINKTIMEOUT   ((PPROPINFO)~IPROP_STD_LINKTIMEOUT)
  355. #define PPROPINFO_STD_LEFTNORUN     ((PPROPINFO)~IPROP_STD_LEFTNORUN)
  356. #define PPROPINFO_STD_TOPNORUN        ((PPROPINFO)~IPROP_STD_TOPNORUN)
  357. #define PPROPINFO_STD_ALIGN        ((PPROPINFO)~IPROP_STD_ALIGN)
  358. #define PPROPINFO_STD_IMEMODE        ((PPROPINFO)~IPROP_STD_IMEMODE) // FK_IME
  359. #define PPROPINFO_STD_LAST        ((PPROPINFO)~IPROP_STD_LAST)
  360.  
  361. //---------------------------------------------------------------------------
  362. // Structure for VBM_DRAGOVER and VBM_DRAGDROP events
  363. //---------------------------------------------------------------------------
  364.  
  365. typedef struct tagDRAGINFO
  366. {
  367.     HCTL   hctl;
  368.     POINT  pt;
  369.     USHORT state;    // Enter, Over, Exit; only used for VBM_DRAGOVER
  370. } DRAGINFO;
  371.  
  372. typedef DRAGINFO NEAR * NPDRAGINFO;
  373. typedef DRAGINFO FAR  * LPDRAGINFO;
  374.  
  375. #define DRAG_STATE_ENTER       0x00
  376. #define DRAG_STATE_EXIT        0x01
  377. #define DRAG_STATE_OVER        0x02
  378.  
  379. //---------------------------------------------------------------------------
  380. // Control MODEL structure
  381. //---------------------------------------------------------------------------
  382. typedef struct tagMODEL
  383.   {
  384.   USHORT    usVersion;        // VB version used by control
  385.   FLONG        fl;            // Bitfield structure
  386.   PCTLPROC    pctlproc;        // The control proc.
  387.   FSHORT    fsClassStyle;        // Window class style
  388.   FLONG        flWndStyle;        // Default window style
  389.   USHORT    cbCtlExtra;        // # bytes alloc'd for HCTL structure
  390.   USHORT    idBmpPalette;        // BITMAP id for tool palette
  391.   PSTR        npszDefCtlName;        // Default control name prefix
  392.   PSTR        npszClassName;        // Visual Basic class name
  393.   PSTR        npszParentClassName;    // Parent window class if subclassed
  394.   NPPROPLIST    npproplist;        // Property list
  395.   NPEVENTLIST    npeventlist;        // Event list
  396.   BYTE        nDefProp;        // Index of default property
  397.   BYTE        nDefEvent;        // Index of default event
  398.   BYTE        nValueProp;        // Index of control value property
  399.   } MODEL;
  400.  
  401. typedef MODEL FAR  *  LPMODEL;
  402.  
  403. #define MODEL_fArrows        0x00000001L
  404. #define MODEL_fFocusOk        0x00000002L
  405. #define MODEL_fMnemonic     0x00000004L
  406. #define MODEL_fChildrenOk   0x00000008L
  407. #define MODEL_fInitMsg        0x00000010L
  408. #define MODEL_fLoadMsg        0x00000020L
  409. #define MODEL_fDesInteract  0x00000040L
  410. #define MODEL_fInvisAtRun   0x00000080L
  411. #define MODEL_fGraphical    0x00000100L
  412.  
  413. //---------------------------------------------------------------------------
  414. // MODELINFO structure
  415. //---------------------------------------------------------------------------
  416. typedef struct tagMODELINFO
  417.   {
  418.   USHORT    usVersion;        // VB version used by control
  419.   LPMODEL FAR  *lplpmodel;        // pointer to null-terminated
  420.   } MODELINFO;                //    list of LPMODELS
  421.  
  422. typedef MODELINFO FAR *LPMODELINFO;
  423.  
  424. //---------------------------------------------------------------------------
  425. // Picture structure
  426. //---------------------------------------------------------------------------
  427. typedef struct tagPIC
  428. {
  429.     BYTE    picType;
  430.     union
  431.     {
  432.     struct
  433.     {
  434.       HBITMAP   hbitmap;        // bitmap
  435.       HPALETTE  hpal;        // accompanying palette
  436.     } bmp;
  437.     struct
  438.     {
  439.       HANDLE    hmeta;        // Metafile
  440.       int        xExt, yExt;     // extent
  441.     } wmf;
  442.     struct
  443.     {
  444.       HICON     hicon;        // Icon
  445.     } icon;
  446.     } picData;
  447.     BYTE    picReserved[4];
  448. } PIC;
  449.  
  450. typedef PIC FAR  *  LPPIC;
  451.  
  452. #define PICTYPE_NONE        0
  453. #define PICTYPE_BITMAP        1
  454. #define PICTYPE_METAFILE    2
  455. #define PICTYPE_ICON        3
  456.  
  457. #define HPIC_INVALID        0xFFFF
  458. #define HPIC_NULL        0
  459.  
  460. //---------------------------------------------------------------------------
  461. // Mode constants
  462. //---------------------------------------------------------------------------
  463. #define MODE_DESIGN    1
  464. #define MODE_RUN    2
  465. #define MODE_BREAK    3
  466. //---------------------------------------------------------------------------
  467. // Control flags for use with VBSetControlFlags
  468. //---------------------------------------------------------------------------
  469. #define CTLFLG_HASPALETTE        0x00000001L
  470. #define CTLFLG_USESPALETTE        0x00000002L
  471. #define CTLFLG_GRAPHICALOPAQUE        0x00000004L
  472. #define CTLFLG_GRAPHICALTRANSLUCENT 0x00000008L
  473.  
  474.  
  475. //---------------------------------------------------------------------------
  476. // The VISUAL BASIC API routines
  477. //---------------------------------------------------------------------------
  478.  
  479. // General routines
  480.  
  481. USHORT    VBAPI VBGetMode(VOID);
  482. USHORT    VBAPI VBGetVersion(VOID);
  483.  
  484. // General control routines
  485.  
  486. LPVOID    VBAPI VBDerefControl(HCTL hctl);
  487. LONG    VBAPI VBDefControlProc(HCTL hctl, HWND hwnd, USHORT msg, USHORT wp, LONG lp);
  488. BOOL    VBAPI VBRegisterModel(HANDLE hmod, LPMODEL lpmdl);
  489. HWND    VBAPI VBGetControlHwnd(HCTL hctl);
  490. HANDLE    VBAPI VBGetHInstance(VOID);
  491. LPMODEL VBAPI VBGetControlModel(HCTL hctl);
  492. LPSTR    VBAPI VBGetControlName(HCTL hctl, LPSTR lpszName);
  493. HCTL    VBAPI VBGetHwndControl(HWND hwnd);
  494. LONG    VBAPI VBSendControlMsg(HCTL hctl, USHORT msg, USHORT wp, LONG lp);
  495. LONG    VBAPI VBSuperControlProc(HCTL hctl, USHORT msg, USHORT wp, LONG lp);
  496. ERR    VBAPI VBRecreateControlHwnd(HCTL hctl);
  497. VOID    VBAPI VBDirtyForm(HCTL hctl);
  498. ERR    VBAPI VBSetErrorMessage(ERR err, LPSTR lpstr);
  499. VOID    VBAPI VBGetAppTitle(LPSTR lpstr, USHORT cbMax);
  500. int    VBAPI VBDialogBoxParam(HANDLE hinst, LPSTR pszTemplateName, FARPROC lpDialogFunc, LONG lp);
  501. ULONG    VBAPI VBSetControlFlags(HCTL hctl, ULONG mask, ULONG value);
  502. HCTL    VBAPI VBGetCapture(VOID);
  503. VOID    VBAPI VBSetCapture(HCTL hctl);
  504. VOID    VBAPI VBReleaseCapture(VOID);
  505. VOID    VBAPI VBMoveControl(HCTL hctl, LPRECT lprect, BOOL fRepaint);
  506. VOID    VBAPI VBGetControlRect(HCTL hctl, LPRECT lprect);
  507. VOID    VBAPI VBGetRectInContainer(HCTL hctl, LPRECT lprect);
  508. VOID    VBAPI VBGetClientRect(HCTL hctl, LPRECT lprect);
  509. VOID    VBAPI VBClientToScreen(HCTL hctl, LPPOINT lppt);
  510. VOID    VBAPI VBScreenToClient(HCTL hctl, LPPOINT lppt);
  511. BOOL    VBAPI VBIsControlVisible(HCTL hctl);
  512. BOOL    VBAPI VBIsControlEnabled(HCTL hctl);
  513. VOID    VBAPI VBInvalidateRect(HCTL hctl, LPRECT lprect, BOOL fEraseBkGnd);
  514. VOID    VBAPI VBUpdateControl(HCTL hctl);
  515.  
  516. HCTL    VBAPI VBGetControl(HCTL hctl, WORD gc);
  517. #define GC_FIRSTSIBLING       0x0000
  518. #define GC_LASTSIBLING          0x0001
  519. #define GC_NEXTSIBLING          0x0002
  520. #define GC_PREVSIBLING          0x0003
  521. #define GC_CHILD          0x0005
  522. #define GC_CONTAINER          0x1000
  523. #define GC_FORM           0x1001
  524. #define GC_FIRSTCONTROL       0x1002
  525. #define GC_NEXTCONTROL          0x1003
  526. #define GC_FIRSTSELECTED      0x1004
  527. #define GC_NEXTSELECTED       0x1005
  528.  
  529. VOID    VBAPI VBZOrder(HCTL hctl, WORD zorder);
  530. #define ZORDER_FRONT    0
  531. #define ZORDER_BACK    1
  532.  
  533. // Management of dynamically allocated strings
  534.  
  535. HSZ    VBAPI VBCreateHsz(HANDLE seg, LPSTR lpszString);
  536. HSZ    VBAPI VBDestroyHsz(HSZ hsz);
  537. LPSTR    VBAPI VBDerefHsz(HSZ hsz);
  538. LPSTR    VBAPI VBLockHsz(HSZ hsz);
  539. VOID    VBAPI VBUnlockHsz(HSZ hsz);
  540.  
  541. // Management of language strings
  542.  
  543. HLSTR    VBAPI VBCreateHlstr(LPVOID pb, USHORT cbLen);
  544. HLSTR    VBAPI VBCreateTempHlstr(LPVOID pb, USHORT cbLen);
  545. VOID    VBAPI VBDestroyHlstr(HLSTR hlstr);
  546. LPSTR    VBAPI VBDerefHlstr(HLSTR hlstr);
  547. LPSTR    VBAPI VBDerefHlstrLen(HLSTR hlstr, USHORT FAR *pCbLen);
  548. LPSTR    VBAPI VBDerefZeroTermHlstr(HLSTR hlstr);
  549. USHORT    VBAPI VBGetHlstr(HLSTR hlstr, LPVOID pb, USHORT cbLen);
  550. USHORT    VBAPI VBGetHlstrLen(HLSTR hlstr);
  551. ERR    VBAPI VBSetHlstr(HLSTR far *phlstr, LPVOID pb, USHORT cbLen);
  552. ERR    VBAPI VBResizeHlstr(HLSTR hlstr, USHORT newCbLen);
  553.  
  554. // Management of language Variant data type
  555.  
  556. ERR    VBAPI VBCoerceVariant(LPVAR lpVar, SHORT vtype, LPVOID lpData);
  557. SHORT    VBAPI VBGetVariantType(LPVAR lpVar);
  558. SHORT    VBAPI VBGetVariantValue(LPVAR lpVar, LPVAL lpVal);
  559. ERR    VBAPI VBSetVariantValue(LPVAR lpVar, SHORT vtype, LPVOID lpData);
  560.  
  561. // Management of language arrays
  562.  
  563. #define LOBOUND(x) ((SHORT)((x) & 0xFFFF))
  564. #define HIBOUND(x) ((SHORT)((x) >> 16))
  565.  
  566. LPVOID VBAPI VBArrayElement(HAD hAD, SHORT cIndex, LPSHORT lpi);
  567.  
  568. LONG    VBAPI VBArrayBounds(HAD hAD, SHORT index);
  569. #define AB_INVALIDINDEX     1      // hAD or index is bad
  570. USHORT    VBAPI VBArrayElemSize(HAD hAD);
  571. LPVOID    VBAPI VBArrayFirstElem(HAD hAD);
  572. SHORT    VBAPI VBArrayIndexCount(HAD hAD);
  573.  
  574. // VB Error routines
  575.  
  576. VOID    VBAPI VBRuntimeError(ERR err);
  577.  
  578. // Floating-point stack save/restore utilities
  579. USHORT    VBAPI VBCbSaveFPState(LPVOID pb, USHORT cb);
  580. VOID    VBAPI VBRestoreFPState(LPVOID pb);
  581.  
  582. // Firing Basic event procedures
  583.  
  584. ERR    VBAPI VBFireEvent(HCTL hctl, USHORT idEvent, LPVOID lpparams);
  585.  
  586. // Control property access
  587.  
  588. ERR    VBAPI VBGetControlProperty(HCTL hctl, USHORT idProp, LPVOID pdata);
  589. ERR    VBAPI VBSetControlProperty(HCTL hctl, USHORT idProp, LONG data);
  590.  
  591. // Picture management functions
  592.  
  593. HPIC    VBAPI VBAllocPic(LPPIC lppic);
  594. HPIC    VBAPI VBAllocPicEx(LPPIC lppic, USHORT usVersion);
  595. VOID    VBAPI VBFreePic(HPIC hpic);
  596. HPIC    VBAPI VBGetPic(HPIC hpic, LPPIC lppic);
  597. HPIC    VBAPI VBGetPicEx(HPIC hpic, LPPIC lppic, USHORT usVersion);
  598. ERR    VBAPI VBPicFromCF(HPIC FAR *lphpic, HANDLE hData, WORD wFormat);
  599. HPIC    VBAPI VBRefPic(HPIC hpic);
  600. VOID    VBAPI VBPaletteChanged(HCTL hctl);
  601. COLOR    VBAPI VBTranslateColor(HCTL hctl, COLOR clr);
  602.  
  603. // File IO functions
  604.  
  605. ERR    VBAPI VBReadFormFile(HFORMFILE hformfile, LPVOID pb, WORD cb);
  606. ERR    VBAPI VBWriteFormFile(HFORMFILE hformfile, LPVOID pb, WORD cb);
  607. LONG    VBAPI VBSeekFormFile(HFORMFILE hformfile, LONG offset);
  608. LONG    VBAPI VBRelSeekFormFile(HFORMFILE hformfile, LONG offset);
  609. ERR    VBAPI VBReadBasicFile(USHORT usFileNo, LPVOID pb, WORD cb);
  610. ERR    VBAPI VBWriteBasicFile(USHORT usFileNo, LPVOID pb, WORD cb);
  611.  
  612. // Conversion functions
  613.  
  614. LONG    VBAPI VBYPixelsToTwips(SHORT Pixels);
  615. LONG    VBAPI VBXPixelsToTwips(SHORT Pixels);
  616. SHORT    VBAPI VBYTwipsToPixels(LONG Twips);
  617. SHORT    VBAPI VBXTwipsToPixels(LONG Twips);
  618.  
  619. // Link Interface functions
  620.  
  621. ERR    VBAPI VBLinkPostAdvise(HCTL hctl);
  622. BOOL    VBAPI VBPasteLinkOk(HANDLE FAR *phTriplet, HCTL hctl);
  623. VOID    VBAPI VBLinkMakeItemName(HCTL hctl, LPSTR lpszBuf);
  624.  
  625. // Exports from .VBX files
  626.  
  627. #ifndef NOCCEXPORTS
  628. BOOL FAR PASCAL _export VBINITCC(USHORT usVersion, BOOL fRuntime);
  629. VOID FAR PASCAL _export VBTERMCC(VOID);
  630. LPMODELINFO FAR PASCAL _export VBGetModelInfo(USHORT usVersion);
  631. #endif // !NOCCEXPORTS
  632.  
  633. // Misc functions
  634.  
  635. SHORT    VBAPI VBFormat(SHORT vtype, LPVOID lpData, LPSTR lpszFmt, LPVOID pb, USHORT cb);
  636.  
  637. #define CONTROLDEREF(type, hctl) ((P##type)(VBDerefControl(hctl)))
  638.  
  639.  
  640. //---------------------------------------------------------------------------
  641. // Visual Basic messages
  642. //---------------------------------------------------------------------------
  643. #define VBM__BASE        ( WM_USER + 0x0C00 )
  644.  
  645. // All properties have been loaded.  Must set MODEL_fLoadMsg to receive.
  646. #define VBM_CREATED        ( VBM__BASE + 0x00 )
  647.  
  648. // Form load is complete or dynamic control is fully loaded.  Must set
  649. // MODEL_fLoadMsg to receive.
  650. #define VBM_LOADED        ( VBM__BASE + 0x01 )
  651.  
  652. // Pre-hwnd properties are not yet loaded (no hwnd exists for control yet).
  653. // Must set MODEL_fInitMsg to receive.
  654. #define VBM_INITIALIZE        ( VBM__BASE + 0x02 )
  655.  
  656. // Get a property value.
  657. // [wp=iprop, lp=pdata], RetVal=ERR
  658. #define VBM_GETPROPERTY     ( VBM__BASE + 0x03 )
  659.  
  660. // Verify a property value.
  661. // [wp=iprop, lp=data], RetVal=ERR
  662. #define VBM_CHECKPROPERTY    ( VBM__BASE + 0x04 )
  663.  
  664. // Set a property value.
  665. // [wp=iprop, lp=data], RetVal=ERR
  666. #define VBM_SETPROPERTY     ( VBM__BASE + 0x05 )
  667.  
  668. // Write a property.
  669. // [wp=iprop, lp=pfileref], RetVal=ERR
  670. #define VBM_SAVEPROPERTY    ( VBM__BASE + 0x06 )
  671.  
  672. // Read a property.
  673. // [wp=iprop, lp=pfileref], RetVal=ERR
  674. #define VBM_LOADPROPERTY    ( VBM__BASE + 0x07 )
  675.  
  676. // Get the string representation of a property.
  677. // [wp=iprop, lp=HSZ FAR *], RetVal=ERR
  678. #define VBM_GETPROPERTYHSZ    ( VBM__BASE + 0x08 )
  679.  
  680. // Create popup window used to change a property.
  681. // [wp=iprop, lp=listbox hwnd], RetVal=popup hwnd
  682. #define VBM_INITPROPPOPUP    ( VBM__BASE + 0x09 )
  683.  
  684. // Determine if Paste/PasteLink is allowed.
  685. // [wp=PASTETYPE], RetVal=BOOL
  686. #define VBM_QPASTEOK        ( VBM__BASE + 0x0A )
  687.  
  688. #define PT_PASTE    0
  689. #define PT_PASTELINK    1
  690.  
  691. // Paste control-specific data from the clipboard.
  692. // [wp=PASTETYPE], RetVal=ERR
  693. #define VBM_PASTE        ( VBM__BASE + 0x0B )
  694.  
  695. // Copy control specific data to the clipboard.
  696. #define VBM_COPY        ( VBM__BASE + 0x0C )
  697.  
  698. // Control activated upon receipt of a unique mnemonic key.
  699. #define VBM_MNEMONIC        ( VBM__BASE + 0x0D )
  700.  
  701. // Posted to fire a deferred event.
  702. // [wp=event]
  703. #define VBM_FIREEVENT        ( VBM__BASE + 0x0E )
  704.  
  705. // Another control in drag mode drug over the control.
  706. // [lp=pdraginfo]
  707. #define VBM_DRAGOVER        ( VBM__BASE + 0x0F )
  708.  
  709. // This message is sent to a control that has just had another control
  710. // in drag mode dropped on it.
  711. // [lp=pdraginfo]
  712. #define VBM_DRAGDROP        ( VBM__BASE + 0x10 )
  713.  
  714. // This message is sent when certain methods are invoked on controls
  715. // [wp=METH_, lp=far *alParams], RetVal=ERR
  716. #define VBM_METHOD        ( VBM__BASE + 0x11 )
  717.  
  718. #define METH_ADDITEM    0x0001    // args are: cArgs, hszItem, [index]
  719. #define METH_REMOVEITEM 0x0002    // args are: cArgs, index
  720. #define METH_REFRESH    0x0003    // no args (lp == NULL)
  721. #define METH_MOVE    0x0004    // args are: cArgs, left, [top, [width, [height]]]
  722. #define METH_DRAG    0x0005    // args are: cArgs, [cmd]
  723. #define METH_LINKSEND   0x0006  // no args (lp == NULL)
  724. #define METH_ZORDER    0x0007    // args are: cArgs, pos
  725. #define METH_CLEAR    0x000A    // no args (lp == NULL)
  726.  
  727. // Clear capture and internal state.
  728. #define VBM_CANCELMODE        ( VBM__BASE + 0x12 )
  729.  
  730. // Paint notification for graphical controls.
  731. // [wp=hdc, lp=lprect]
  732. #define VBM_PAINT        ( VBM__BASE + 0x14 )
  733.  
  734. // Hit test for graphical controls.
  735. // [lp=lphittest], RetVal = HT_
  736. #define VBM_HITTEST        ( VBM__BASE + 0x15 )
  737.  
  738. #define HT_ON          7
  739. #define HT_SOLID_NEAR      6
  740. #define HT_PATTERN_NEAR   5
  741. #define HT_HOLLOW_NEAR      4
  742. #define HT_SOLID      3
  743. #define HT_PATTERN      2
  744. #define HT_HOLLOW      1
  745. #define HT_MISS       0
  746. typedef struct tagHITTEST
  747.   {
  748.   POINT pt;        // Point to test (in parent's coordinates)
  749.   RECT    rect;        // Rect of self (in parent's coordinates)
  750.   } HITTEST;
  751. typedef HITTEST FAR *LPHITTEST;
  752.  
  753. // Paint the multi-select handles
  754. // [wp=hdc, lp=rect(in hdc coords)]
  755. #define VBM_PAINTMULTISEL    ( VBM__BASE + 0x16 )
  756.  
  757. // Paint the "gray rect" or ctl outline while moving/sizing ctl.
  758. // [wp=hdc, lp=rect(in hdc coords)]
  759. #define VBM_PAINTOUTLINE    ( VBM__BASE + 0x17 )
  760.  
  761. // Palette change notification.
  762. // [wp=fPalBack(for SelectPalette)], RetVal = return from RealizePalette
  763. #define VBM_PALETTECHANGED    ( VBM__BASE + 0x1B )
  764.  
  765. // Get control palette.
  766. // RetVal = HPALETTE.
  767. #define VBM_GETPALETTE        ( VBM__BASE + 0x1C )
  768.  
  769. // Enumerate available formats.
  770. // [wp=SUPPLIESDATAFORMAT | ACCEPTSDATAFORMAT]
  771. // [LOWORD(lp)=ennumeration(0-x)]
  772. #define VBM_LINKENUMFORMATS    ( VBM__BASE + 0x1E )
  773.  
  774. // Ask a control for it's LINK item name.  Return item name as lpsz in lp.
  775. // [wp=LINKSRCASK | LINKSRCTELL]
  776. // [lp=lpszItemName]
  777. #define VBM_LINKGETITEMNAME    ( VBM__BASE + 0x1F )
  778.  
  779. // For Server items and client pokes.
  780. // [wp=wFormat lp=LPLINKDATA]
  781. #define VBM_LINKGETDATA     ( VBM__BASE + 0x20 )
  782.  
  783. // Used in client requests, advises, and server pokes.
  784. // [wp=wFormat lp=LPLINKDATA]
  785. #define VBM_LINKSETDATA     ( VBM__BASE + 0x21 )
  786.  
  787. // Get help on property or event name.
  788. // [LOBYTE(wp)=VBHELP_, HIBYTE(wp)=iprop/ievent, lp=lpmodel]
  789. #define VBM_HELP        ( VBM__BASE + 0x22 )
  790.  
  791. #define VBHELP_PROP    0x0001
  792. #define VBHELP_EVT    0x0002
  793. #define VBHELP_CTL        0x0003
  794.  
  795. // Get default size of control
  796. // LOWORD(RetVal)=cx, HIWORD(RetVal)=cy
  797. #define VBM_GETDEFSIZE        ( VBM__BASE + 0x23 )
  798.  
  799. // Just like VBM_SAVE(LOAD)PROPERTY, but saves (loads) as text.
  800. #define VBM_SAVETEXTPROPERTY    ( VBM__BASE + 0x24 )
  801. #define VBM_LOADTEXTPROPERTY    ( VBM__BASE + 0x25 )
  802.  
  803. // Is char a mnemonic for this control?
  804. // [wp=char] RetVal=TRUE/FALSE
  805. #define VBM_ISMNEMONIC        ( VBM__BASE + 0x26 )
  806.  
  807. // Does control want to see WM_KEYUP/WM_KEYDOWN for vk?  Sent only
  808. // for keys which are normally trapped by VB.  E.g. Tab, Enter, etc.
  809. // [wp=vk] RetVal=TRUE/FALSE
  810. #define VBM_WANTSPECIALKEY    ( VBM__BASE + 0x27 )
  811.  
  812. //Notifies a control that it has been selected in the property window.
  813. //[wp=multiselect ON (TRUE) or OFF (FALSE)]
  814. //[LOWORD(lp)=multiselect count (0 first, n last)]
  815. #define VBM_SELECTED            ( VBM__BASE + 0x28 )
  816.  
  817. // Notifications reflected back to control from parent.
  818. #define VBN__BASE        (VBM__BASE + 0x1000)
  819.  
  820. #define VBN_COMMAND        (VBN__BASE + WM_COMMAND)
  821. #define VBN_CTLCOLOR        (VBN__BASE + WM_CTLCOLOR)
  822. #define VBN_DRAWITEM        (VBN__BASE + WM_DRAWITEM)
  823. #define VBN_MEASUREITEM     (VBN__BASE + WM_MEASUREITEM)
  824. #define VBN_DELETEITEM        (VBN__BASE + WM_DELETEITEM)
  825. #define VBN_VKEYTOITEM        (VBN__BASE + WM_VKEYTOITEM)
  826. #define VBN_CHARTOITEM        (VBN__BASE + WM_CHARTOITEM)
  827. #define VBN_COMPAREITEM     (VBN__BASE + WM_COMPAREITEM)
  828. #define VBN_HSCROLL        (VBN__BASE + WM_HSCROLL)
  829. #define VBN_VSCROLL        (VBN__BASE + WM_VSCROLL)
  830. #define VBN_PARENTNOTIFY    (VBN__BASE + WM_PARENTNOTIFY)
  831.  
  832. // Data xfer structure for VBM_LINKGETDATA or VBM_LINKSETDATA
  833.  
  834. typedef struct tagLinkData
  835.   {
  836.   WORD     wReserved;
  837.   DWORD    cb;      // size of data
  838.   HANDLE   hData;   // Handle to data
  839.   DWORD    dwReserved;
  840.   } VBLINKDATA;
  841.  
  842. typedef VBLINKDATA FAR *LPLINKDATA;
  843.  
  844. // link modes
  845.  
  846. #define LINKMODENONE            0
  847. #define LINKMODEAUTO            1
  848. #define LINKMODEMANUAL            2
  849. #define LINKMODENOTIFY                  3
  850.  
  851. #define LINKMODESERVERPOKE        1
  852. #define LINKMODESERVERNOPOKE        2
  853.  
  854. #define VBDDEDATA VBLINKDATA
  855. #define LPDDEDATA LPLINKDATA
  856.  
  857. // Various DDE defines
  858.  
  859. #define MAX_EXEC                        256
  860. #define MAXLINKITEMNAME                 256
  861.  
  862. #define ACCEPTSDATAFORMAT                1
  863. #define SUPPLIESDATAFORMAT               2
  864.  
  865. #define LINKSRCASK                       0
  866. #define LINKSRCTELL                      1
  867.  
  868. #define LINK_DATA_OK             0
  869. #define LINK_DATA_OOM             1
  870. #define LINK_DATA_FORMATBAD         2
  871. #define LINK_DATA_SETFAILED         3
  872.  
  873. #define errInitOnNonServerDesk   6  // Attempted to Initate on a channel that
  874.                     // had linkmode set to None.
  875.  
  876. #define errAllServerChUsed       7  // The Server Channel array is filled.
  877.  
  878. #define errDataSettingFailed     8  // The Set quality failed possible string
  879.                     // too long.
  880.  
  881. #define errOutOfMemoryForLink    11
  882. #ifdef __cplusplus 
  883. #endif 
  884.