DALMyBooks.h
上传用户:weisheen
上传日期:2022-07-09
资源大小:19390k
文件大小:2k
源码类别:
ActiveX/DCOM/ATL
开发平台:
Visual C++
- // DALMyBooks.h : Declaration of the CDALMyBooks
- #ifndef __DALMYBOOKS_H_
- #define __DALMYBOOKS_H_
- #include "resource.h" // main symbols
- /////////////////////////////////////////////////////////////////////////////
- // CDALMyBooks
- class ATL_NO_VTABLE CDALMyBooks :
- public CComObjectRootEx<CComSingleThreadModel>,
- public CComCoClass<CDALMyBooks, &CLSID_DALMyBooks>,
- public ISupportErrorInfo,
- public IDispatchImpl<IDALMyBooks, &IID_IDALMyBooks, &LIBID_EXDALLib>
- {
- public:
- CDALMyBooks()
- {
- }
- DECLARE_REGISTRY_RESOURCEID(IDR_DALMYBOOKS)
- DECLARE_PROTECT_FINAL_CONSTRUCT()
- BEGIN_COM_MAP(CDALMyBooks)
- COM_INTERFACE_ENTRY(IDALMyBooks)
- COM_INTERFACE_ENTRY(IDispatch)
- COM_INTERFACE_ENTRY(ISupportErrorInfo)
- END_COM_MAP()
- // ISupportsErrorInfo
- STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
- // IDALMyBooks
- public:
- STDMETHOD(get_DataSource)(/*[out, retval]*/ BSTR *pVal);
- STDMETHOD(put_DataSource)(/*[in]*/ BSTR newVal);
- STDMETHOD(get_PWD)(/*[out, retval]*/ BSTR *pVal);
- STDMETHOD(put_PWD)(/*[in]*/ BSTR newVal);
- STDMETHOD(get_UID)(/*[out, retval]*/ BSTR *pVal);
- STDMETHOD(put_UID)(/*[in]*/ BSTR newVal);
- STDMETHOD(Update)(/*[in]*/ DTOBook* Book, /*[out]*/ UINT* iResult);
- STDMETHOD(DeleteBookById)(/*[in]*/ UINT id, /*[out]*/ UINT* iResult);
- STDMETHOD(SaveBook)(/*[in]*/ DTOBook* bookdata, /*[out]*/ UINT* pResult);
- STDMETHOD(QueryAllBook)(/*[out]*/ DTOBook** allBook);
- STDMETHOD(GetBookByIsbn)(/*[in]*/ UINT bookisbn,/*[out]*/ DTOBook** mybook);
- private:
- _ConnectionPtr GetMyConn();
- CString m_sqlQueryById;
- CString m_sqlQueryAll;
- CString m_sqlUpdate;
- CString m_sqlSave;
- CString m_sqlDelete;
- CString m_UID;
- CString m_PWD;
- CString m_DataSource;
- };
- #endif //__DALMYBOOKS_H_