⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 idbasynchstatusimpl.h

📁 The ATL OLE DB Provider templates only seem to support read-only rowsets and making them support upd
💻 H
字号:
#ifndef __I_DB_ASYNCH_STATUS_IMPL__INCLUDED__
#define __I_DB_ASYNCH_STATUS_IMPL__INCLUDED__


#include <atlcom.h>
#include <atldb.h>

template <class T>
class ATL_NO_VTABLE IDBAsynchStatusImpl : public IDBAsynchStatus
{
public:

   STDMETHOD(Abort)(
      HCHAPTER      hChapter,
      ULONG         ulOperation)
   {
		ATLTRACE2(atlTraceDBProvider, 0, "IDBAsynchStatus::Abort()\n");

      // The docs say... 

      // We should enumerate all connected clients and call IDBAsynchNotify::OnProgress() 
      // with with a ulAsynchPhase of DBASYNCHPHASE_CANCELED etc... If this ever gets called
      // we might do that...

      return S_OK;
   }

   STDMETHOD(GetStatus)(
      HCHAPTER         hChapter,
      ULONG            ulOperation,
      ULONG*            pulProgress,
      ULONG*            pulProgressMax,
      ULONG*            pulAsynchPhase,
      LPOLESTR *      ppwszStatusText)
   {
      ATLTRACE2(atlTraceDBProvider, 0, "IDBAsynchStatus::GetStatus()\n");

      if (hChapter != DB_NULL_HCHAPTER)
      {
         ATLTRACE2(atlTraceDBProvider, 0, "Error: hChapter is not DB_NULL_HCHAPTER and we dont do chapters\n");
         return E_UNEXPECTED;
      }
      
      if (ulOperation != DBASYNCHOP_OPEN)
      {
         ATLTRACE2(atlTraceDBProvider, 0, "Error: ulOperation is not DBASYNCHOP_OPEN and the docs say it should be\n");
         return E_UNEXPECTED;
      }

      // We'll ignore these for now

      if (pulProgress)
      {
         *pulProgress = 1;
      }

      if (pulProgressMax)
      {
         *pulProgressMax = 1;
      }

      if (pulAsynchPhase)
      {
         *pulAsynchPhase = DBASYNCHPHASE_COMPLETE;
      }

      if (ppwszStatusText)
      {
         *ppwszStatusText = 0;
      }

      return S_OK;
   }

};

#endif // __I_ROWSET_LOCATE_IMPL__INCLUDED__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -