DALMyBooks.cpp
上传用户:weisheen
上传日期:2022-07-09
资源大小:19390k
文件大小:3k
源码类别:
ActiveX/DCOM/ATL
开发平台:
Visual C++
- // DALMyBooks.cpp : Implementation of CDALMyBooks
- #include "stdafx.h"
- #include "ExDAL.h"
- #include "DALMyBooks.h"
- /////////////////////////////////////////////////////////////////////////////
- // CDALMyBooks
- STDMETHODIMP CDALMyBooks::InterfaceSupportsErrorInfo(REFIID riid)
- {
- static const IID* arr[] =
- {
- &IID_IDALMyBooks
- };
- for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
- {
- if (InlineIsEqualGUID(*arr[i],riid))
- return S_OK;
- }
- return S_FALSE;
- }
- STDMETHODIMP CDALMyBooks::GetBookByIsbn(UINT bookisbn, DTOBook **mybook)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- _ConnectionPtr conn=this->GetMyConn();
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::QueryAllBook(DTOBook **allBook)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::SaveBook(DTOBook *bookdata, UINT *pResult)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::DeleteBookById(UINT id, UINT *iResult)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::Update(DTOBook *Book, UINT *iResult)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- _ConnectionPtr CDALMyBooks::GetMyConn()
- {
- CString strFormat="Provider=OraOLEDB.Oracle.1;User Id=%s;Data Source=%s";
- CString str;
- str.Format(strFormat,this->m_UID,this->m_DataSource);
- _ConnectionPtr mytools;
- mytools.CreateInstance(__uuidof(Connection));
- mytools->Open(_bstr_t(str),"",_bstr_t(this->m_PWD),-1);
- return mytools;
- }
- STDMETHODIMP CDALMyBooks::get_UID(BSTR *pVal)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::put_UID(BSTR newVal)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::get_PWD(BSTR *pVal)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::put_PWD(BSTR newVal)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::get_DataSource(BSTR *pVal)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }
- STDMETHODIMP CDALMyBooks::put_DataSource(BSTR newVal)
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState())
- // TODO: Add your implementation code here
- return S_OK;
- }