home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / FERRAMEN / VXC / VXB.H < prev    next >
Encoding:
Text File  |  1993-06-18  |  16.8 KB  |  411 lines

  1. /*
  2. ┌──────────────────────────────────────────────────────────────────────────┐
  3. │ vxBase xbase for Visual Basic library                                    │
  4. │ Copyright 1993 vxBase Systems                                            │
  5. ├────────────────┬──────┬────────────┬────────┬───────────────┬────────────┤
  6. │ SYSTEM         │ VX   │ PROGRAM ID │ VXB.H  │ CREATION DATE │  09/24/91  │
  7. ├────────────────┼──────┴────────────┴────────┴───────────────┴────────────┤
  8. │ PROGRAM TITLE  │  vxbase dynamic link lib header file                    │
  9. ├─────┬──────┬───┴┬───────────────────────────┬────────────────────────────┤
  10. │ REV │ DATE │ BY │ DESCRIPTION               │ Written by T. Orletsky     │
  11. ├─────┼──────┼────┼───────────────────────────┴────────────────────────────┤
  12. │ 001 │920307│ TO │ add functions vxInit and vxDeallocate                  │
  13. │ 002 │920313│ TO │ add function vxReplLogical                             │
  14. │ 003 │920317│ TO │ add functions vxJoinNoAuto, vxDbfDate                  │
  15. │ 003 │930504│ TO │ add functions vxPictureImport, vxIsPicture             │
  16. └─────┴──────┴────┴────────────────────────────────────────────────────────┘
  17. */
  18.  
  19. /* ********************************************************* */
  20. /*                 Function Prototypes                       */
  21. /*                                                           */ 
  22. /*      ensure that windows.h is included BEFORE vxb.h       */
  23. /*      vxbase.lib must be included in your make             */
  24. /*                                                           */ 
  25. /* Functions NOT defined here that are described in the      */
  26. /* vxbase manual are for Visual Basic only. They operate on  */
  27. /* VB controls included in the Microsoft CDK VB API lib.     */ 
  28. /*                                                           */ 
  29. /* ********************************************************* */
  30.  
  31.    int    FAR  PASCAL vxAppendBlank (void);
  32.    int    FAR  PASCAL vxAppendFrom  (char *);
  33.    int    FAR  PASCAL vxAreaDbf     (char *);
  34.    int    FAR  PASCAL vxAreaNtx     (char *);
  35.    HANDLE FAR PASCAL  vxBlobRead    (char *);
  36.    int    FAR PASCAL  vxBlobWrite   (HANDLE, char *);
  37.    int    FAR  PASCAL vxBof         (void);
  38.    int    FAR  PASCAL vxBottom      (void);
  39.    void   FAR  PASCAL vxBrowse      (HWND, int, int, int, int, int, long, char *, long *);
  40.    void   FAR  PASCAL vxBrowseCase  (int);
  41.    void   FAR  PASCAL vxBrowsePos   (int, int, int, int);
  42.    void   FAR  PASCAL vxBrowseSetup (int, int, int, int, char *, int, int, int, int, int, int); 
  43.    long   FAR  PASCAL vxChar        (char *); 
  44.    int    FAR  PASCAL vxClose       (void);
  45.    int    FAR  PASCAL vxCloseAll    (void);
  46.    int    FAR  PASCAL vxCloseNtx    (int);
  47.    void   FAR  PASCAL vxCollate     (int *);
  48.    int    FAR  PASCAL vxCopy        (char *);
  49.    int    FAR  PASCAL vxCopyStruc   (char *);
  50.    int    FAR  PASCAL vxCreateDbf   (char *, int, char *);
  51.    int    FAR  PASCAL vxCreateNtx   (char *, char *);
  52.    int    FAR  PASCAL vxCreateSubNtx(char *, char *, char *);
  53.    int    FAR  PASCAL vxCtlBrowse   (HWND, int, int, int, long, HWND, char *);
  54.    long   FAR  PASCAL vxCtlBrowseMsg(HWND, int, void *);
  55.    int    FAR  PASCAL vxCtlFormat   (int, int, int);
  56.    void   FAR  PASCAL vxCtlGraySet  (void);
  57.    void   FAR  PASCAL vxCtlGrayReset(void);
  58.    long   FAR  PASCAL vxDateFormat  (char *);
  59.    long   FAR  PASCAL vxDateString  (char *, int);
  60.    int    FAR  PASCAL vxDbfCurrent  (void);
  61.    long   FAR  PASCAL vxDbfDate     (void);
  62.    long   FAR  PASCAL vxDbfName     (void);
  63.    int    FAR  PASCAL vxDeallocate  (void);
  64.    int    FAR  PASCAL vxDecimals    (char *);
  65.    int    FAR  PASCAL vxDeleted     (void);
  66.    int    FAR  PASCAL vxDeleteRange (long, long);
  67.    int    FAR  PASCAL vxDeleteRec   (void);
  68.    long   FAR  PASCAL vxDescend     (char *);
  69.    void   FAR  PASCAL vxDouble      (char *, double *);
  70.    int    FAR  PASCAL vxEmpty       (char *);
  71.    int    FAR  PASCAL vxEof         (void);
  72.    int    FAR  PASCAL vxEval        (char *);
  73.    int    FAR  PASCAL vxEvalDouble  (char *, double *);
  74.    int    FAR  PASCAL vxEvalLogical (char *, char *);
  75.    int    FAR  PASCAL vxEvalString  (char *, char *);
  76.    void   FAR  PASCAL vxExactOff    (void);
  77.    void   FAR  PASCAL vxExactOn     (void);
  78.    long   FAR  PASCAL vxField       (char *); 
  79.    int    FAR  PASCAL vxFieldCount  (void);
  80.    long   FAR  PASCAL vxFieldName   (int);
  81.    int    FAR  PASCAL vxFieldSize   (char *);
  82.    long   FAR  PASCAL vxFieldTrim   (char *);
  83.    long   FAR  PASCAL vxFieldType   (char *);
  84.    int    FAR  PASCAL vxFile        (char *);
  85.    void   FAR  PASCAL vxFilter      (char *);
  86.    void   FAR  PASCAL vxFilterReset (void);
  87.    void   FAR  PASCAL vxFormFrame   (HWND);
  88.    int    FAR  PASCAL vxFound       (void);
  89.    long   FAR  PASCAL vxGetVersion  (void);
  90.    int    FAR  PASCAL vxGo          (long);
  91.    void   FAR  PASCAL vxInit        (void);
  92.    int    FAR  PASCAL vxInteger     (char *);
  93.    int    FAR  PASCAL vxIsMemo      (char *);
  94.    int    FAR  PASCAL vxIsPicture   (char *);
  95.    int    FAR  PASCAL vxIsRecLocked (void);
  96.    int    FAR  PASCAL vxIsSubNtx    (int);
  97.    void   FAR  PASCAL vxJoin        (int, int, char *, int, char *);
  98.    void   FAR  PASCAL vxJoinNoAuto  (void);
  99.    void   FAR  PASCAL vxJoinReset   (void);
  100.    long   FAR  PASCAL vxLocate      (char *, int);
  101.    long   FAR  PASCAL vxLocateAgain (int);
  102.    int    FAR  PASCAL vxLockDbf     (void);
  103.    int    FAR  PASCAL vxLocked      (void);
  104.    int    FAR  PASCAL vxLockRecord  (void);
  105.    void   FAR  PASCAL vxLockRetry   (int, int);
  106.    long   FAR  PASCAL vxLong        (char *);
  107.    long   FAR  PASCAL vxMemCompact  (void);
  108.    int    FAR  PASCAL vxMemoClear   (char *);
  109.    void   FAR  PASCAL vxMemoEdit    (HWND, char *);
  110.    void   FAR  PASCAL vxMemoPos     (int, int, int, int, char *);
  111.    long   FAR  PASCAL vxMemoRead    (char *, int);
  112.    int    FAR  PASCAL vxMemRealloc  (int, int, int);
  113.    void   FAR  PASCAL vxMenuDeclare (int);
  114.    void   FAR  PASCAL vxMenuItem    (int, int, char *, int);
  115.    int    FAR  PASCAL vxNtxCurrent  (void);
  116.    int    FAR  PASCAL vxNtxDeselect (void);
  117.    long   FAR  PASCAL vxNtxExpr     (int);
  118.    long   FAR  PASCAL vxNtxName     (int);
  119.    long   FAR  PASCAL vxNtxRecNo    (void);
  120.    long   FAR  PASCAL vxNtxSubExpr  (int);
  121.    long   FAR  PASCAL vxNumRecs     (void);
  122.    long   FAR  PASCAL vxNumRecsFilter(void);
  123.    long   FAR  PASCAL vxNumRecsSub  (void);
  124.    int    FAR  PASCAL vxPack        (HWND);
  125.    int    FAR  PASCAL vxPictureImport (char *, char *);
  126.    int    FAR  PASCAL vxPictureRead   (HWND, char *);
  127.    long   FAR  PASCAL vxPrinterDefault(void);
  128.    long   FAR  PASCAL vxPrinterEnum   (int);
  129.    int    FAR  PASCAL vxPrinterSelect (char *);
  130.    int    FAR  PASCAL vxRecall      (void);
  131.    long   FAR  PASCAL vxRecNo       (void);
  132.    int    FAR  PASCAL vxRecord      (char *);
  133.    int    FAR  PASCAL vxRecSize     (void);
  134.    int    FAR  PASCAL vxReindex     (void);
  135.    void   FAR  PASCAL vxReplDate    (char *, char *);
  136.    void   FAR  PASCAL vxReplDateString(char *, char *);
  137.    void   FAR  PASCAL vxReplDouble  (char *, double *);
  138.    void   FAR  PASCAL vxReplInteger (char *, int *);
  139.    void   FAR  PASCAL vxReplLogical (char *, int);
  140.    void   FAR  PASCAL vxReplLong    (char *, long *);
  141.    int    FAR  PASCAL vxReplMemo    (char *, char *);
  142.    void   FAR  PASCAL vxReplRecord  (char *);
  143.    void   FAR  PASCAL vxReplString  (char *, char *);
  144.    int    FAR  PASCAL vxSeek        (char *);
  145.    int    FAR  PASCAL vxSeekFast    (char *);
  146.    int    FAR  PASCAL vxSeekSoft    (char *);
  147.    int    FAR  PASCAL vxSelectDbf   (int);
  148.    int    FAR  PASCAL vxSelectNtx   (int);
  149.    int    FAR  PASCAL vxSetAlias    (char *, int);
  150.    void   FAR  PASCAL vxSetAnsi     (int);
  151.    void   FAR  PASCAL vxSetCollate  (int);
  152.    void   FAR  PASCAL vxSetDate     (int);
  153.    void   FAR  PASCAL vxSetErrorCaption(char *);
  154.    void   FAR  PASCAL vxSetErrorMethod (int);
  155.    int    FAR  PASCAL vxSetHandles  (int);
  156.    void   FAR  PASCAL vxSetLanguage (int);
  157.    void   FAR  PASCAL vxSetLocks    (int);
  158.    void   FAR  PASCAL vxSetMeters   (int);
  159.    int    FAR  PASCAL vxSetRelation (int, char *);
  160.    void   FAR  PASCAL vxSetSelect   (int);
  161.    void   FAR  PASCAL vxSetString   (int);
  162.    void   FAR  PASCAL vxSetupPrinter(HWND);
  163.    int    FAR  PASCAL vxSkip        (long);
  164.    void   FAR  PASCAL vxSum         (char *, double *);
  165.    void   FAR  PASCAL vxTableDeclare(long, char *, char *, int, int, int);
  166.    void   FAR  PASCAL vxTableField  (int, char *, char *, int );
  167.    void   FAR  PASCAL vxTableFieldExt(int, char *, char *, int, int, int);
  168.    void   FAR  PASCAL vxTableReset  (void);
  169.    int    FAR  PASCAL vxTestNtx     (int);
  170.    int    FAR  PASCAL vxTop         (void);
  171.    int    FAR  PASCAL vxTrue        (char *);
  172.    int    FAR  PASCAL vxUnlock      (void);
  173.    int    FAR  PASCAL vxUseDbf      (char *);
  174.    int    FAR  PASCAL vxUseDbfAgain (char *);
  175.    int    FAR  PASCAL vxUseDbfEX    (char *);
  176.    int    FAR  PASCAL vxUseDbfRO    (char *);
  177.    int    FAR  PASCAL vxUseNtx      (char *);
  178.    void   FAR  PASCAL vxWindowDereg (HWND);
  179.    int    FAR  PASCAL vxWrite       (void);
  180.    int    FAR  PASCAL vxWriteHdr    (void);
  181.    int    FAR  PASCAL vxZap         (void);
  182.  
  183.  
  184. /* ********************************************************* */
  185. /*        c function prototypes to create 3d controls        */
  186. /*        in dialog boxes. Adapted from Ray Donahue's        */
  187. /*        three_d.dll                                        */
  188. /*        DO NOT USE VB SPECIFIC vxCtlStyle/vxCtlLength      */
  189. /* ********************************************************* */
  190.    void   FAR PASCAL      Draw3dShadow   (HWND,WORD);
  191.    void   FAR PASCAL      Draw3dBorder   (HWND,WORD,int,int);
  192.    void   FAR PASCAL      Draw3dFrame    (HWND,int);
  193.    HBRUSH FAR PASCAL      Control3dColor (HWND,WORD);
  194.  
  195. #define WM_3DPAINT      (WM_USER+100)
  196. #define INSIDE_FRAME    0
  197. #define OUTSIDE_FRAME   1
  198. #define RAISED          0
  199. #define RECESSED        1
  200. #define CREASED         2
  201. #define SHADOW          3
  202.  
  203.  
  204. /* ********************************************************* */
  205. /*        c specific functions not documented in             */
  206. /*        vxbase manual                                      */
  207. /* ********************************************************* */
  208.    void   FAR  PASCAL vxbTrim       (char *, int);
  209.    // right trim where char* is pointer to string
  210.    // and int is the string length
  211.    // (note: does not require 0 delimited string)
  212.  
  213.    void   FAR  PASCAL vxErrorMsg(int);
  214.    // display a vxbase error message
  215.  
  216.    int    FAR  PASCAL vxChrToInt(char *, int);
  217.    // convert string to integer where char * is
  218.    // pointer to string and int is the string length
  219.    // (note: does not require 0 delimited string)
  220.  
  221.    char * FAR PASCAL vxLongToChr(long, char *, int);
  222.    // convert long to string whose length is int
  223.    // returns pointer to same string as param 2
  224.  
  225.    char * FAR PASCAL vbFormatDate (char *, char *);
  226.    // change xbase date string (CCYYMMDD) (1st param)
  227.    // into format specified by 2nd param (e.g. "MM/DD/YY")
  228.  
  229.  
  230.  
  231. /* ********************************************************* */
  232. /*      error structure if alternate error method is used    */
  233. /* ********************************************************* */
  234. typedef struct
  235.    {
  236.    int  ErrorNum;
  237.    char ErrorMsg[80];
  238.    int  DbfArea;
  239.    int  NtxArea;
  240.    char DbfName[80];
  241.    char NtxName[80];
  242.    char BadParm[80];
  243.    }  VXERRORSTRUC;
  244.  
  245. typedef VXERRORSTRUC *PVXERROR;
  246.  
  247. int FAR PASCAL vxErrorTest(PVXERROR);
  248.  
  249. /* ********************************************* */
  250. /* field structure for file create using vbCreate*/
  251. /* ********************************************* */
  252. typedef struct
  253.    {
  254.    char    name[11];
  255.    char    type;
  256.    int     width;
  257.    int     decimals;
  258.    int     internaluse;
  259.    }  FIELD;
  260.  
  261.  
  262. // function gets pointer to current field array
  263. FIELD * FAR PASCAL  vbFldPtr (void);
  264.  
  265.   int   FAR PASCAL  vbCreate (char *, int, FIELD *);
  266.  
  267. // param 1 = file name
  268. // param 2 = number of fields
  269. // param 3 = FIELD structure defining the field
  270. //           leave internaluse integer as zero
  271.  
  272. /* ******************* */
  273. /* index key structure */
  274. /* ******************* */
  275. typedef struct
  276.    {
  277.    long  blockno;
  278.    long  dbf_recno;
  279.    char  key_size[512 - 3 * sizeof(long)];
  280.    }  KEY;
  281.  
  282. /* **************************** */
  283. /* undocumented index functions */
  284. /* **************************** */
  285.  
  286. // position index pointer to first index rec in tree
  287.    int    FAR PASCAL vbNtxTop     (int);
  288. // param 1 = virtual index area (vxUseNtx area - 1)
  289.  
  290. // skip inside an index tree
  291.    long   __export FAR PASCAL vbNtxSkip    (int, long);
  292. // param 1 = virtual index area (vxUseNtx area - 1)
  293. // param 2 = number of recs to skip (negative backwards)
  294.  
  295. // get a pointer to the current key structure
  296.    KEY *  __export FAR PASCAL vbNtxKey     (int);
  297. // param 1 = virtual index area (vxUseNtx area - 1)
  298. // the result is defined as
  299. //         KEY    *IndexKey;
  300. // and the current dbf rec number can be extracted with
  301. //   IndexKey  = vbNtxKey(IndexArea - 1);
  302. //   CurrRecNo = IndexKey->dbf_recno;
  303.  
  304.  
  305. /* ********************************************************* */
  306. /*                    miscellaneous definitions              */
  307. /* ********************************************************* */
  308.  
  309. /* ********************************************************* */
  310. /*      browse return values                                 */
  311. /* ********************************************************* */
  312. #define BROWSE_CLOSED  -1L
  313. #define BROWSE_EDIT    -2L
  314. #define BROWSE_ADD     -3L
  315. #define BROWSE_DELETE  -4L
  316. #define BROWSE_ERROR   -5L
  317. #define BROWSE_USER    -6L
  318.  
  319. /* ********************************************************* */
  320. /*      menu types                                           */
  321. /* ********************************************************* */
  322. #define VX_SEPBAR   2
  323. #define VX_MENUHEAD 1
  324. #define VX_RETURN   0
  325.  
  326. /* ********************************************************* */
  327. /*      date types                                           */
  328. /* ********************************************************* */
  329. #define VX_AMERICAN 0
  330. #define VX_ANSI     1
  331. #define VX_BRITISH  2
  332. #define VX_FRENCH   3
  333. #define VX_GERMAN   4
  334. #define VX_ITALIAN  5
  335. #define VX_DUTCH    6
  336. #define VX_SPANISH  7
  337.  
  338. /* language types    */
  339. /* (including above) */
  340. /* ***************** */
  341. #define VX_ENGLISH  0
  342.  
  343. /* ********************************************************* */
  344. /*         color references are defined as 0x00bbggrr        */
  345. /* ********************************************************* */
  346. #define VX_RED        0x000000FF
  347. #define VX_BLUE       0x00FF0000
  348. #define VX_GRAY       0x00C0C0C0
  349.  
  350. /* ********************************************************* */
  351. /*      vxTableField types                                   */
  352. /* ********************************************************* */
  353. #define VX_FIELD 0
  354. #define VX_EXPR  1
  355.  
  356. /* ********************************************************* */
  357. /*      vxBrowseCase types                                   */
  358. /* ********************************************************* */
  359. #define VX_UPPER 0
  360. #define VX_LOWER 1
  361.  
  362. /* ********************************************************* */
  363. /*      vxCtlFormat types (including VX_UPPER above)         */
  364. /* ********************************************************* */
  365. #define VX_CHAR       1
  366. #define VX_ALPHA      2
  367. #define VX_NUM        3
  368. #define VX_DATE       4
  369. #define VX_PASSWORD   5
  370.  
  371. /* ********************************************************* */
  372. /*      vxSetString types                                    */
  373. /* ********************************************************* */
  374. #define VX_VBSTRING 0
  375. #define VX_ASCIIZ   1
  376.  
  377. /* ********************************************************* */
  378. /*      font weights for vxBrowseSetup                       */
  379. /* ********************************************************* */
  380. #define VX_DONTCARE      0
  381. #define VX_THIN        100
  382. #define VX_EXTRALIGHT  200
  383. #define VX_LIGHT       300
  384. #define VX_NORMAL      400
  385. #define VX_MEDIUM      500
  386. #define VX_SEMIBOLD    600
  387. #define VX_BOLD        700
  388. #define VX_EXTRABOLD   800
  389. #define VX_HEAVY       900
  390.  
  391. /* ********************************************************* */
  392. /*      vxCtlBrowse Messages                                 */
  393. /* ********************************************************* */
  394. #define VXB_REFRESH        0
  395. #define VXB_FILTERDLG      1
  396. #define VXB_FILTERPRG      2
  397. #define VXB_GETCURRENTREC  3
  398. #define VXB_GETTOPREC      4
  399. #define VXB_STATS          5
  400. #define VXB_CASE           6
  401. #define VXB_SEARCHDLG      7
  402. #define VXB_SEARCHPRG      8
  403. #define VXB_SEARCHAGAIN    9
  404. #define VXB_SEEK          10
  405. #define VXB_CLOSE         11
  406. #define VXB_QUICKDISPLAY  12
  407.  
  408. /* ********************************************************* */
  409. /*                        End Header                         */
  410. /* ********************************************************* */
  411.