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

模拟服务器

开发平台:

C/C++

  1. /************************************************************************
  2. ** _ D B D A O . H *
  3. ** *
  4. *************************************************************************
  5. ** Copyright (C) 1996 by Microsoft Corporation   *
  6. **    All Rights Reserved   *
  7. ************************************************************************/
  8. /*
  9. _DBDAO.H
  10. Internal definitions and prototypes for dbdao C++ classes
  11. */
  12. #ifndef __DBDAO_H_
  13. #define __DBDAO_H_
  14. /*****************************************************************************
  15. * Forwards
  16. */
  17. class COleVariant;
  18. class CdbBookmark;
  19. class CdbException;
  20. class CdbOleObject;
  21. class CdbObject;
  22. class CdbError;
  23. class CdbProperty;
  24. class CdbDBEngine;
  25. class CdbWorkspace;
  26. class CdbDatabase;
  27. class CdbConnection;
  28. class CdbRecordset;
  29. class CdbGetRowsEx;
  30. class CdbQueryDef;
  31. class CdbTableDef;
  32. class CdbField;
  33. class CdbRelation;
  34. class CdbIndex;
  35. class CdbUser;
  36. class CdbGroup;
  37. class CdbDocument;
  38. class CdbContainer;
  39. class CdbParameter;
  40. class CdbCollection;
  41. class CdbErrors;
  42. class CdbProperties;
  43. class CdbWorkspaces;
  44. class CdbDatabases;
  45. class CdbConnections;
  46. class CdbRecordsets;
  47. class CdbQueryDefs;
  48. class CdbTableDefs;
  49. class CdbFields;
  50. class CdbRelations;
  51. class CdbIndexes;
  52. class CdbUsers;
  53. class CdbGroups;
  54. class CdbDocuments;
  55. class CdbContainers;
  56. class CdbParameters;
  57. class CdbBStr;
  58. /*****************************************************************************
  59. * DAO runtime key
  60. */
  61. const char szKEY[] = "mbmabptebkjcdlgtjmskjwtsdhjbmkmwtrak";
  62. /*****************************************************************************
  63. * Miscellaneous defines
  64. */
  65. #define DAO_MAXSEEKFIELDS 13
  66. /*****************************************************************************
  67. * CdbBSTR (OLE BSTR helper)
  68. */
  69. class DLLEXPORT CdbBSTR
  70. {
  71. public:
  72. CONSTRUCTOR CdbBSTR (BSTR=NULL);
  73. DESTRUCTOR ~CdbBSTR (VOID);
  74. operator BSTR * (VOID);
  75. operator LPCTSTR (VOID);
  76. private:
  77. BSTR m_bstr;
  78. };
  79. /*****************************************************************************
  80. * CdbVariant (OLE Variant helper)
  81. */
  82. class CdbVariant : public COleVariant
  83. {
  84. public:
  85. CONSTRUCTOR CdbVariant (LONG l);
  86. CONSTRUCTOR                     CdbVariant                      (VOID);
  87. CONSTRUCTOR                     CdbVariant                      (LPCTSTR pstr);
  88. CONSTRUCTOR                     CdbVariant                      (SHORT s, BOOL bIsBool = FALSE);
  89. CONSTRUCTOR                     CdbVariant                      (LPVARIANT pv);
  90. CONSTRUCTOR                     CdbVariant                      (LPSAFEARRAY psa);
  91. VOID                            operator =                      (LPVARIANT pv);
  92. VOID                            operator =                      (LPCTSTR pstr);
  93. VOID                            operator =                      (SHORT s);
  94. VOID                            operator =                      (const int i);
  95. VOID                            operator =                      (LONG l);
  96. };
  97. inline CONSTRUCTOR CdbVariant::CdbVariant(
  98. VOID) : COleVariant()
  99. {
  100. vt = VT_ERROR;
  101. scode = DISP_E_PARAMNOTFOUND;
  102. }
  103. inline CdbVariant::CdbVariant (LONG l)
  104. {
  105. if (l == -1)
  106. {
  107. vt = VT_ERROR;
  108. scode = DISP_E_PARAMNOTFOUND;
  109. }
  110. else
  111. {
  112. vt = VT_I4;
  113. lVal = l;
  114. }
  115. }
  116. inline CONSTRUCTOR CdbVariant::CdbVariant(
  117. LPCTSTR pstr): COleVariant(pstr,VT_BSTRT)
  118. {
  119. if (!pstr)
  120. {
  121. VariantClear(this);
  122. vt = VT_ERROR;
  123. scode = DISP_E_PARAMNOTFOUND;
  124. }
  125. }
  126. inline CONSTRUCTOR CdbVariant::CdbVariant(
  127. SHORT s, BOOL bIsBool) : COleVariant(s)
  128. {
  129. if (bIsBool)
  130. {
  131. vt = VT_BOOL;
  132. boolVal = s;
  133. }
  134. else if (s==-1)
  135. {
  136. vt = VT_ERROR;
  137. scode = DISP_E_PARAMNOTFOUND;
  138. }
  139. }
  140. inline CONSTRUCTOR CdbVariant::CdbVariant(
  141. LPVARIANT pv)
  142. {
  143. if (!pv)
  144. {
  145. vt = VT_ERROR;
  146. scode = DISP_E_PARAMNOTFOUND;
  147. }
  148. else
  149. VariantCopy(this, pv);
  150. }
  151. inline CONSTRUCTOR CdbVariant::CdbVariant(
  152. LPSAFEARRAY psa)
  153. {
  154. if (!psa)
  155. {
  156. vt = VT_ERROR;
  157. scode = DISP_E_PARAMNOTFOUND;
  158. }
  159. else
  160. {
  161. vt = VT_ARRAY|VT_UI1;
  162. parray = psa;
  163. }
  164. }
  165. inline VOID CdbVariant::operator =(
  166. LPVARIANT pv)
  167. {
  168. if (!pv)
  169. {
  170. vt = VT_ERROR;
  171. scode = DISP_E_PARAMNOTFOUND;
  172. }
  173. else
  174. VariantCopy(this, pv);
  175. }
  176. inline VOID CdbVariant::operator =(
  177. LPCTSTR pstr) 
  178. {
  179. if (!pstr)
  180. {
  181. VariantClear(this);
  182. vt = VT_ERROR;
  183. scode = DISP_E_PARAMNOTFOUND;
  184. }
  185. else
  186. {
  187. #ifdef UNICODE
  188. bstrVal = SysAllocString(pstr);
  189. #else
  190. bstrVal = SysAllocStringByteLen(pstr, strlen(pstr));
  191. #endif
  192. vt = VT_BSTR;
  193. }
  194. }
  195. inline VOID CdbVariant::operator =(
  196. SHORT s)
  197. {
  198. if (s==-1)
  199. {
  200. vt = VT_ERROR;
  201. scode = DISP_E_PARAMNOTFOUND;
  202. }
  203. else
  204. {
  205. vt = VT_I2;
  206. iVal = s;
  207. }
  208. }
  209. inline VOID CdbVariant::operator =(
  210. const int i)
  211. {
  212. if (i==-1)
  213. {
  214. vt = VT_ERROR;
  215. scode = DISP_E_PARAMNOTFOUND;
  216. }
  217. else
  218. {
  219. vt = VT_I2;
  220. iVal = (SHORT)i;
  221. }
  222. }
  223. inline VOID CdbVariant::operator =(
  224. LONG  l)
  225. {
  226. if (l==-1)
  227. {
  228. vt  = VT_ERROR;
  229. scode = DISP_E_PARAMNOTFOUND;
  230. }
  231. else
  232. {
  233. vt = VT_I4;
  234. lVal = l;
  235. }
  236. }
  237. /*****************************************************************************
  238. * CdbWide
  239. */
  240. HRESULT CdbWideFromAnsi(LPSTR, unsigned int, BSTR *);
  241. class CdbWide
  242. {
  243. public:
  244. CONSTRUCTOR CdbWide (LPSTR pstr, unsigned int cb=0)
  245. {
  246. CdbWideFromAnsi(pstr, (pstr ? (cb==0 ? strlen(pstr) : cb) : 0), &m_bstr);
  247. }
  248. DESTRUCTOR ~CdbWide ()
  249. {
  250. SysFreeString(m_bstr);
  251. }
  252. operator LPWSTR ()
  253. {
  254. return (LPWSTR)m_bstr;
  255. }
  256. operator LPSTR ()
  257. {
  258. return (LPSTR)m_bstr;
  259. }
  260. ULONG cBytes ()
  261. {
  262. return SysStringByteLen(m_bstr);
  263. }
  264. private:
  265. BSTR m_bstr;
  266. };
  267. /*****************************************************************************
  268. * CdbOleObject
  269. */
  270. class DLLEXPORT CdbOleObject : public CObject
  271. {
  272. public:
  273. CONSTRUCTOR                             CdbOleObject            (VOID);
  274. virtual DESTRUCTOR ~CdbOleObject           (VOID);
  275. BOOL                                    Exists                  (VOID);
  276. CdbOleObject & operator =              (CdbOleObject &o);
  277. operator LPUNKNOWN (){ return GetInterface();}
  278. VOID                                    SetInterface            (LPUNKNOWN punk, BOOL bAddRef=FALSE);
  279. VOID                                    SetInterface            (REFIID riidClass, REFIID riidInterface);
  280. VOID                                    SetInterfaceLic         (REFIID riidClass, REFIID riidInterface);
  281. LPUNKNOWN GetInterface            (BOOL bAddRef=FALSE, BOOL bThrowException=TRUE) const;
  282. virtual VOID OnInterfaceChange       (VOID);
  283. VOID                                    SetRichErrorInfo        (LPOLESTR pstrSource, LPOLESTR pstrDescription, LPOLESTR pstrHelpFile, ULONG ulHelpID) const;
  284. protected:
  285. BOOL                                    StartOLE                        (VOID);
  286. LPUNKNOWN                               m_punkInterface;
  287. };
  288. /*****************************************************************************
  289. * CdbCollection
  290. */
  291. class DLLEXPORT CdbCollection : public CdbOleObject
  292. {
  293. public:
  294. // Methods
  295. virtual CdbObject               ObItem                  (LONG i) = 0;
  296. virtual CdbObject               ObItem                  (LPCTSTR pstr) = 0;
  297. virtual LONG                    GetCount                (VOID) = 0;
  298. virtual VOID                    ObAppend                (CdbObject &obj) = 0;
  299. virtual VOID                    Delete                  (LPCTSTR pstr) = 0;
  300. virtual VOID                    Refresh                 (VOID) = 0;
  301. };
  302. class DLLEXPORT CdbStaticCollection : public CdbCollection
  303. {
  304. public:
  305. CdbObject                               ObItem                  (LONG i);
  306. CdbObject                               ObItem                  (LPCTSTR pstr);
  307. LONG                                    GetCount                (VOID);
  308. VOID                                    ObAppend                (CdbObject &obj);
  309. VOID                                    Delete                  (LPCTSTR pstr);
  310. VOID                                    Refresh                 (VOID) ;
  311. };
  312. class DLLEXPORT CdbDynamicCollection : public CdbCollection
  313. {
  314. public:
  315. CdbObject                               ObItem                  (LONG i);
  316. CdbObject                               ObItem                  (LPCTSTR pstr);
  317. LONG                                    GetCount                (VOID);
  318. VOID                                    ObAppend                (CdbObject &obj);
  319. VOID                                    Delete                  (LPCTSTR pstr);
  320. VOID                                    Refresh                 (VOID);
  321. };
  322. #define DAOMFC_STATIC_COLLECTION_DECL(objColl, objSingle, intSingle)    
  323. class DLLEXPORT objColl : public CdbStaticCollection                                                    
  324. {                                                                                                                               
  325. public:                                                                                                                 
  326. objSingle                       Item                            (LONG i);                               
  327. objSingle                       Item                            (LPCTSTR pstr);                 
  328. objSingle                       operator[]                      (LONG i);                               
  329. objSingle                       operator[]                      (LPCTSTR pstr);                 
  330. }
  331. #define DAOMFC_DYNAMIC_COLLECTION_DECL(objColl, objSingle, intSingle)   
  332. class DLLEXPORT objColl : public CdbDynamicCollection                                                   
  333. {                                                                                                                               
  334. public:                                                                                                                 
  335. objSingle                       Item                            (LONG i);                               
  336. objSingle                       Item                            (LPCTSTR pstr);                 
  337. VOID                            Append                          (objSingle &o);                 
  338. objSingle                       operator[]                      (LONG i);                               
  339. objSingle                       operator[]                      (LPCTSTR pstr);                 
  340. }
  341. DAOMFC_STATIC_COLLECTION_DECL(CdbErrors, CdbError, DAOError);
  342. DAOMFC_STATIC_COLLECTION_DECL(CdbDatabases, CdbDatabase, DAODatabase);
  343. //Connections are special cased so we can trap the copy constructor
  344. DAOMFC_STATIC_COLLECTION_DECL(CdbRecordsets, CdbRecordset, DAORecordset);
  345. DAOMFC_STATIC_COLLECTION_DECL(CdbParameters, CdbParameter, DAOParameter);
  346. DAOMFC_STATIC_COLLECTION_DECL(CdbDocuments, CdbDocument, DAODocument);
  347. DAOMFC_STATIC_COLLECTION_DECL(CdbContainers, CdbContainer, DAOContainer);
  348. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbProperties, CdbProperty, DAOProperty);
  349. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbFields, CdbField, DAOField);
  350. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbQueryDefs, CdbQueryDef, DAOQueryDef);
  351. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbTableDefs, CdbTableDef, DAOTableDef);
  352. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbIndexes, CdbIndex, DAOIndex);
  353. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbRelations, CdbRelation, DAORelation);
  354. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbUsers, CdbUser, DAOUser);
  355. DAOMFC_DYNAMIC_COLLECTION_DECL(CdbGroups, CdbGroup, DAOGroup);
  356. //Need some extra functions in CdbWorkspaces to support the delay in creating the 
  357. //default workspace needed to support the JET/ODBC option.
  358. class DLLEXPORT CdbWorkspaces : public CdbDynamicCollection
  359. {        
  360. friend CdbDBEngine;
  361. private:
  362. DAODBEngine * pDBEng;
  363. BOOL m_bDontStart;
  364. public:                                                                                                                 
  365. CONSTRUCTOR                     CdbWorkspaces (VOID){pDBEng = NULL;}
  366. CdbWorkspace                    Item                    (LONG i);                               
  367. CdbWorkspace                    Item                    (LPCTSTR pstr);                 
  368. VOID                            Append                  (CdbWorkspace &o);                 
  369. CdbWorkspace                    operator[]              (LONG i);                         
  370. CdbWorkspace                    operator[]              (LPCTSTR pstr);                
  371. VOID                            SetDBEngine             (DAODBEngine *peng){pDBEng = peng;}
  372. VOID                         GetDelayedInterface     ();
  373. };
  374. //Need to trap Connections in the copy constructor so the user can't
  375. //get a "sorta-kinda" working Connections collection on a Jet workspace
  376. class DLLEXPORT CdbConnections : public CdbStaticCollection
  377. {        
  378. public:
  379. CONSTRUCTOR CdbConnections (CdbConnections &Connections);
  380. CONSTRUCTOR CdbConnections (){pwrk = NULL;}
  381. CdbConnection                   Item                    (LONG i);                               
  382. CdbConnection                   Item                    (LPCTSTR pstr);                 
  383. CdbConnection                   operator[]              (LONG i);                               
  384. CdbConnection                   operator[]              (LPCTSTR pstr);               
  385. CdbConnections & operator = (CdbConnections &o);
  386. LONG                            GetCount                (VOID);
  387. VOID                            Refresh                 (VOID) ;
  388. VOID SetWorkspace (DAOWorkspace * pParent){pwrk = pParent;}
  389. private:
  390. VOID CheckInterface();
  391. DAOWorkspace * pwrk;
  392. };
  393. /*****************************************************************************
  394. * CdbObject
  395. */
  396. class DLLEXPORT CdbObject : public CdbOleObject
  397. {
  398. public:
  399. CONSTRUCTOR                             CdbObject                       (VOID);
  400. CONSTRUCTOR                             CdbObject                       (LPUNKNOWN punk, BOOL bAddRef=FALSE);
  401. virtual CString                 GetName                         (VOID); 
  402. virtual VOID                    SetName                         (LPCTSTR pstr);
  403. CdbProperties                   Properties;
  404. };
  405. /*****************************************************************************
  406. * CdbGetRowsEx  (holds GetRowsEx for Recordset)
  407. */
  408. class DLLEXPORT CdbGetRowsEx : public CdbObject
  409. {
  410. public:
  411. // Administration
  412. CONSTRUCTOR                     CdbGetRowsEx            (VOID);
  413. CONSTRUCTOR                     CdbGetRowsEx            (ICDAORecordset *pGetRows, BOOL bAddRef=FALSE);
  414. CONSTRUCTOR                     CdbGetRowsEx            (const CdbGetRowsEx &);
  415. CdbGetRowsEx &          operator =                      (const CdbGetRowsEx &);
  416. VOID                            OnInterfaceChange       (VOID);
  417. };
  418. /*****************************************************************************
  419. * Helper macros
  420. */
  421. //Initialize a variant
  422. #define DAOVINIT(var)
  423. do
  424. {
  425. (var).vt = VT_ERROR;
  426. (var).scode = DISP_E_PARAMNOTFOUND;
  427. }
  428. while (0)
  429. // LPTSTR to VARIANT
  430. #define STV(pstr) CdbVariant(pstr)
  431. // LPTSTR to BSTR
  432. #define STB(pstr) V_BSTR(((LPVARIANT)STV(pstr)))
  433. // LONG to VARIANT
  434. #define LTV(l) CdbVariant(l)
  435. // Optional LONG to VARIANT
  436. #define OLTV(l) CdbVariant((l))
  437. // C/C++ bool to DAO bool
  438. #define BTB(b) ((VARIANT_BOOL)(b?-1:0))
  439. // C/C++ bool to VARIANT
  440. #define BTV(b) CdbVariant(BTB(b), TRUE)
  441. // C/C++ short to VARIANT
  442. #define SHTV(s) CdbVariant((SHORT)s)
  443. // OLE variant to VARIANT
  444. #define VTV(pv) CdbVariant(pv)
  445. // SAFEARRAY to VARIANT
  446. #define ATV(psa, var)
  447. do
  448. {
  449. if (!psa)
  450. {
  451. var.vt = VT_ERROR;
  452. var.scode = DISP_E_PARAMNOTFOUND;
  453. }
  454. else
  455. {
  456. var.vt = VT_ARRAY|VT_UI1;
  457. SafeArrayCopy(psa, &var.parray);
  458. }
  459. }
  460. while (0)
  461. #define DAOMFC_CALL(hr)
  462. do 
  463.     HRESULT  hresult = (hr);           
  464. if(FAILED(hresult)) 
  465. TRACE0("nDBDAO Call Failed.nt"); 
  466. TRACE2("nIn file %s on line %dn", _T("DBDAO.CPP"), __LINE__); 
  467. TRACE1("hResult = %Xn", hresult); 
  468. if (GetScode(hresult) == E_OUTOFMEMORY) 
  469. AfxThrowMemoryException(); 
  470. else 
  471. throw CdbException(hresult); 
  472. } while (0)
  473. /*****************************************************************************
  474. * Property Set/Get helper macros
  475. */
  476. // Get a LONG property
  477. #define LPROPGET(intDAO, meth)
  478. do
  479. {
  480. intDAO * p = (intDAO *)GetInterface();
  481. LONG l = 0;
  482. DAOMFC_CALL(p->meth(&l));
  483. return l;
  484. }
  485. while (0)
  486. // Set a LONG property
  487. #define LPROPSET(intDAO, meth, l)
  488. do
  489. {
  490. intDAO * p = (intDAO *)GetInterface();
  491. DAOMFC_CALL(p->meth(l));
  492. }
  493. while(0)
  494. // Get a SHORT property
  495. #define WPROPGET(intDAO, meth)
  496. do
  497. {
  498. intDAO * p = (intDAO *)GetInterface();
  499. SHORT s = 0;
  500. DAOMFC_CALL(p->meth(&s));
  501. return s;
  502. }
  503. while (0)
  504. // Set a SHORT property
  505. #define WPROPSET(intDAO, meth, s)
  506. do
  507. {
  508. intDAO * p = (intDAO *)GetInterface();
  509. DAOMFC_CALL(p->meth(s));
  510. }
  511. while(0)
  512. // Get a STRING property
  513. #define SPROPGET(intDAO, meth)
  514. do
  515. {
  516. intDAO * p = (intDAO *)GetInterface();
  517. CdbBSTR bstr;
  518. DAOMFC_CALL(p->meth(bstr));
  519. return bstr;
  520. }
  521. while (0)
  522. // Set a STRING property
  523. #define SPROPSET(intDAO, meth, s)
  524. do
  525. {
  526. intDAO * p = (intDAO *)GetInterface();
  527. DAOMFC_CALL(p->meth(STB(s)));
  528. }
  529. while(0)
  530. // Get a DATETIME property
  531. #define DPROPGET(intDAO, meth)
  532. do
  533. {
  534. intDAO * p = (intDAO *)GetInterface();
  535. VARIANT  Var;
  536. VariantInit(&Var);
  537. DAOMFC_CALL(p->meth(&Var));
  538. return Var;
  539. }
  540. while (0)
  541. // Set a DATETIME property
  542. #define DPROPSET(intDAO, meth, pv)
  543. do
  544. {
  545. intDAO * p = (intDAO *)GetInterface();
  546. DAOMFC_CALL(p->meth(*pv));
  547. }
  548. while(0)
  549. // Get a BOOLEAN property
  550. #define BPROPGET(intDAO, meth)
  551. do
  552. {
  553. intDAO * p = (intDAO *)GetInterface();
  554. VARIANT_BOOL vb = 0;
  555. DAOMFC_CALL(p->meth(&vb));
  556. return (BOOL)vb;
  557. }
  558. while (0)
  559. // Set a BOOLEAN property
  560. #define BPROPSET(intDAO, meth, b)
  561. do
  562. {
  563. intDAO * p = (intDAO *)GetInterface();
  564. DAOMFC_CALL(p->meth(BTB(b)));
  565. }
  566. while(0)
  567. // Get a VARIANT property
  568. #define VPROPGET(intDAO, meth)
  569. do
  570. {
  571. intDAO * p = (intDAO *)GetInterface();
  572. COleVariant  v;
  573. VariantInit(&v);
  574. DAOMFC_CALL(p->meth(&v));
  575. return &v;
  576. }
  577. while (0)
  578. // Set a VARIANT property
  579. #define VPROPSET(intDAO, meth, pv)
  580. do
  581. {
  582. intDAO * p = (intDAO *)GetInterface();
  583. DAOMFC_CALL(p->meth(*pv));
  584. }
  585. while(0)
  586. // Get a DWORD property
  587. #define DWPROPGET(intDAO, meth)
  588. do
  589. {
  590. intDAO * p = (intDAO *)GetInterface();
  591. DWORD dw = 0;
  592. DAOMFC_CALL(p->meth(&dw));
  593. return dw;
  594. }
  595. while (0)
  596. #define DAOMFC_STATIC_COLLECTION_IMPL(objColl, objSingle, intColl, intSingle)  
  597. objSingle objColl::Item (LONG i)  { return (intSingle *)(ObItem(i).GetInterface(TRUE)); }  
  598. objSingle objColl::Item (LPCTSTR pstr) { return (intSingle *)(ObItem(pstr).GetInterface(TRUE)); } 
  599. objSingle objColl::operator[] (LONG i) { return (intSingle *)(Item(i).GetInterface(TRUE)); } 
  600. objSingle objColl::operator[] (LPCTSTR pstr) { return (intSingle *)(Item(pstr).GetInterface(TRUE)); }
  601. #define DAOMFC_DYNAMIC_COLLECTION_IMPL(objColl, objSingle, intColl, intSingle)  
  602. objSingle objColl::Item (LONG i)  { return (intSingle *)(ObItem(i).GetInterface(TRUE)); }  
  603. objSingle objColl::Item (LPCTSTR pstr) { return (intSingle *)(ObItem(pstr).GetInterface(TRUE)); } 
  604. VOID objColl::Append (objSingle &o) { ObAppend(o); } 
  605. objSingle objColl::operator[] (LONG i) { return (intSingle *)(Item(i).GetInterface(TRUE)); } 
  606. objSingle objColl::operator[] (LPCTSTR pstr) { return (intSingle *)(Item(pstr).GetInterface(TRUE)); }
  607. DECLARE_INTERFACE_(DAOMFCSCollection, _DAOCollection)
  608. {
  609. STDMETHOD(get_Item) (VARIANT index, LPUNKNOWN *ppunk);
  610. };
  611. DECLARE_INTERFACE_(DAOMFCDCollection, _DAODynaCollection)
  612. {
  613. STDMETHOD(get_Item) (VARIANT index, LPUNKNOWN *ppunk);
  614. };
  615. #endif // __DBDAO_H_