#pragma once /*================================================================= Copyright (C) 2016 BizStation Corp All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =================================================================*/ #include "resource.h" #include "tdclatl_i.h" #include using namespace ATL; class ATL_NO_VTABLE CConnMgr : public CComObjectRootEx, public CComCoClass, public ISupportErrorInfo, public IDispatchImpl { bzs::db::protocol::tdap::client::connMgr* m_mgr; public: CConnMgr() : m_mgr(NULL) {} DECLARE_REGISTRY_RESOURCEID(IDR_CONNMGR) BEGIN_COM_MAP(CConnMgr) COM_INTERFACE_ENTRY(IConnMgr) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) END_COM_MAP() STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { if (m_mgr)m_mgr->release(); } public: STDMETHOD(SetDatabase)(VARIANT db); STDMETHOD(Connect)(BSTR uri, VARIANT_BOOL* retVal); STDMETHOD(Disconnect)(); STDMETHOD(Databases)(IConnRecords** retVal); STDMETHOD(Tables)(BSTR dbname, IConnRecords** retVal); STDMETHOD(Views)(BSTR dbname, IConnRecords** retVal); STDMETHOD(SchemaTables)(BSTR dbname, IConnRecords** retVal); STDMETHOD(Sysvars)(IConnRecords** retVal); STDMETHOD(SlaveStatus)(BSTR channel, IConnRecords** retVal); STDMETHOD(Connections)(IConnRecords** retVal); #ifdef _WIN64 STDMETHOD(InUseDatabases)(__int64 connid, IConnRecords** retVal); STDMETHOD(InUseTables)(__int64 connid, int db, IConnRecords** retVal); STDMETHOD(PostDisconnectOne)(__int64 connid); #else STDMETHOD(InUseDatabases)(BSTR connid, IConnRecords** retVal); STDMETHOD(InUseTables)(BSTR connid, int db, IConnRecords** retVal); STDMETHOD(PostDisconnectOne)(BSTR connid); #endif STDMETHOD(PostDisconnectAll)(); STDMETHOD(get_Stat)(short* retVal); STDMETHOD(TdapErr)(OLE_HANDLE hWnd, BSTR* retVal); STDMETHOD(RemoveSystemDb)(IConnRecords** retVal); STDMETHOD(SlaveStatusName)(int index, BSTR* retVal); STDMETHOD(SysvarName)(int index, BSTR* retVal); STDMETHOD(Statusvars)(IConnRecords** retVal); STDMETHOD(StatusvarName)(int index, BSTR* retVal); STDMETHOD(Extendedvars)(IConnRecords** retVal); STDMETHOD(SlaveHosts)(IConnRecords** retVal); STDMETHOD(Channels)(IConnRecords** retVal); STDMETHOD(ExtendedVarName)(int index, BSTR* retVal); STDMETHOD(HaLock)(VARIANT_BOOL* retVal); STDMETHOD(HaUnlock)(); STDMETHOD(SetRole)(int v, VARIANT_BOOL* retVal); STDMETHOD(SetTrxBlock)(VARIANT_BOOL v, VARIANT_BOOL* retVal); STDMETHOD(SetEnableFailover)(VARIANT_BOOL v, VARIANT_BOOL* retVal); STDMETHOD(get_IsOpen)(VARIANT_BOOL* retVal); }; OBJECT_ENTRY_AUTO(__uuidof(ConnMgr), CConnMgr)