home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / daogetrw.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  5.1 KB  |  155 lines

  1. /************************************************************************
  2. **  D A O G E T R W . H                                                 *
  3. **                                                                      *
  4. **  GetRows interface                                                   *
  5. **                                                                      *
  6. **  Warning: This file is copied from cdaost.h. Changes must be made    *
  7. **           in both files                                              *
  8. **                                                                      *
  9. **                                                                      *
  10. *************************************************************************
  11. ** Copyright (C) 1996 - 1999 Microsoft Corporation                          *
  12. **         All Rights Reserved                                          *
  13. ************************************************************************/
  14.  
  15. #if !defined (_DAOGETRW_H_)
  16. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  17. #define _DAOGETRW_H_
  18.  
  19. /*
  20.     Enumerations
  21. */
  22. typedef enum
  23.     {
  24.     DAOCOLKIND_IND = 0,
  25.     DAOCOLKIND_STR,
  26.     DAOCOLKIND_WSTR
  27.     } DAOCOLKIND;
  28.  
  29. typedef enum
  30.     {
  31.     DAO_I2 = 0,
  32.     DAO_I4,
  33.     DAO_R4,
  34.     DAO_R8,
  35.     DAO_CURRENCY,
  36.     DAO_DATE,
  37.     DAO_BOOL,
  38.     DAO_BSTR,
  39.     DAO_LPSTR,
  40.     DAO_LPWSTR,
  41.     DAO_BLOB,
  42.     DAO_BYTES,
  43.     DAO_CHAR,
  44.     DAO_WCHAR,
  45.     DAO_ANYVARIANT,
  46.     DAO_BOOKMARK,
  47.     DAO_BYTE,
  48.     DAO_GUID,
  49.     DAO_DATATYPEMAX
  50.     } DAODATATYPE;
  51.  
  52. /*
  53.     Macros
  54. */
  55. #define DAO_NOINDICATOR 0xffffffff
  56. #define DAO_NULL        0xffffffff
  57. #define DAO_CANTCOERCE  0xfffffffc
  58. #define DAO_NOMAXLENGTH 0x00000000
  59.  
  60. #define DAOROWFETCH_CALLEEALLOCATES     0x00000001
  61. #define DAOROWFETCH_DONTADVANCE         0x00000002
  62. #define DAOROWFETCH_FORCEREFRESH        0x00000004
  63. #define DAOROWFETCH_BINDABSOLUTE        0x00000008
  64. #define DAOROWFETCH_ODBCNEXT            0x00000010
  65.  
  66. #define DAOBINDING_DIRECT               0x00000001
  67. #define DAOBINDING_VARIANT              0x00000002
  68. #define DAOBINDING_CALLBACK             0x00000004
  69.  
  70. /*
  71.     Structures
  72. */
  73. typedef struct
  74.     {
  75.     DWORD           dwKind;
  76.     union
  77.         {
  78.         LONG        ind;
  79.         LPCSTR      lpstr;
  80.         LPCWSTR        lpwstr;
  81.         };
  82.     } DAOCOLUMNID;
  83. typedef DAOCOLUMNID *LPDAOCOLUMNID;
  84.  
  85. // Callback for binding
  86. EXTERN_C typedef HRESULT (STDAPICALLTYPE *LPDAOBINDFUNC)(ULONG cb, DWORD dwUser, LPVOID *ppData);
  87. #define DAOBINDINGFUNC(f)   STDAPI f (ULONG cb, DWORD dwUser, LPVOID *ppData)
  88.  
  89. typedef struct
  90.     {
  91.     DAOCOLUMNID     columnID;
  92.     ULONG           cbDataOffset;
  93.     ULONG           cbMaxLen;
  94.     ULONG           cbInfoOffset;
  95.     DWORD           dwBinding;
  96.     DWORD           dwDataType;
  97.     DWORD           dwUser;
  98.     } DAOCOLUMNBINDING;
  99. typedef DAOCOLUMNBINDING *LPDAOCOLUMNBINDING;
  100.  
  101. typedef struct
  102.     {
  103.     ULONG           cRowsRequested;
  104.     DWORD           dwFlags;
  105.     LPVOID          pData;
  106.     LPVOID          pVarData;
  107.     ULONG           cbVarData;
  108.     ULONG           cRowsReturned;
  109.     } DAOFETCHROWS;
  110. typedef DAOFETCHROWS *LPDAOFETCHROWS;
  111.  
  112. /*
  113.     New Errors
  114.  
  115.     **NOTE: OLE standard ids to be determined.
  116. */
  117. #define S_BUFFERTOOSMALL    MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1000)
  118. #define S_ENDOFCURSOR       MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1001)
  119. #define S_SILENTCANCEL      MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1002)
  120. #define S_RECORDDELETED     MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1003)
  121.  
  122. #define E_ROWTOOSHORT       MAKE_SCODE(SEVERITY_ERROR,      FACILITY_ITF,   0x1000)
  123. #define E_BADBINDINFO       MAKE_SCODE(SEVERITY_ERROR,      FACILITY_ITF,   0x1001)
  124. #define E_COLUMNUNAVAILABLE MAKE_SCODE(SEVERITY_ERROR,      FACILITY_ITF,   0x1002)
  125.  
  126.  
  127. /*
  128.     Interfaces
  129. */
  130. #undef INTERFACE
  131. #define INTERFACE ICDAORecordset
  132. DECLARE_INTERFACE_(ICDAORecordset, IDispatch)
  133.     {
  134.     STDMETHOD(GetRows)          (THIS_ LONG cRowsToSkip, LONG cCol, LPDAOCOLUMNBINDING prgBndCol, ULONG cbRowLen, LPDAOFETCHROWS pFetchRows) PURE;
  135.     STDMETHOD(SetNotify)        (THIS_ REFIID riid, BOOL fNotify);
  136.     STDMETHOD(GetNotify)        (THIS_ REFIID riid, BOOL *fNotify);
  137.     STDMETHOD(OnBeforeNotify)    (THIS_ REFIID riid, DWORD cat, DWORD rsn, VARIANT v1, VARIANT v2);
  138.     STDMETHOD(OnAfterNotify)    (THIS_ REFIID riid, DWORD cat, DWORD rsn, VARIANT v1, VARIANT v2, HRESULT hr);
  139.     STDMETHOD(PutLock)            (THIS_ BOOL f);
  140.     STDMETHOD(GetLock)            (THIS_ BOOL *f);
  141.     STDMETHOD(AddGetRowsErr)    (THIS_ HRESULT hr) PURE;
  142.     };
  143.  
  144. //Get rows errors
  145. #define errVtoFetchBuffTooSmall    -30028    //3640    The fetch buffer was too small for the amount of data you requested.
  146. #define errVtoEOFDuringFetch    -30029    //3641    There are fewer records remaining in the recordset than you requested.
  147. #define errVtoSilentCancel        -30030    //3642    A cancel was performed on the operation.
  148. #define errVtoRecordDeleted        -30031    //3643    One of the records in the recordset was deleted by another process.
  149. #define errVtoRowLenTooSmall    -30032    //3646    The specified row length is shorter than the sum of the column lengths.
  150. #define errVtoBadBindInfo        -30033    //3645    One of the binding parameters is incorrect.
  151. #define errVtoColumnMissing        -30034    //3647    A column requested is not being returned to the recordset.
  152.  
  153. #pragma option pop /*P_O_Pop*/
  154. #endif // _DAOGETRW_H_
  155.