daogetrw.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:5k
源码类别:

模拟服务器

开发平台:

C/C++

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