dbsrvimp.h
来自「Visual C++实践与提高-刘刀桂, 孟繁晶编著」· C头文件 代码 · 共 57 行
H
57 行
#ifndef _DBSERVERIMP_INCLUDE
#define _DBSERVERIMP_INCLUDE
#include "..\interface\dbsrv.h"
typedef long HRESULT;
class CDB : public IDB, public IDBAccess, public IDBManage, public IDBInfo {
// Interfaces
public:
// Interface for data access
HRESULT _stdcall Read(short nTable, short nRow, LPWSTR lpszData);
HRESULT _stdcall Write(short nTable, short nRow, LPCWSTR lpszData);
// Interface for database management
HRESULT _stdcall Create(short &nTable, LPCWSTR lpszName);
HRESULT _stdcall Delete(short nTable);
// Interfase para obtenber informacion sobre la base de datos
HRESULT _stdcall GetNumTables(short &nNumTables);
HRESULT _stdcall GetTableName(short nTable, LPWSTR lpszName);
HRESULT _stdcall GetNumRows(short nTable, short &nRows);
HRESULT _stdcall QueryInterface(REFIID riid, void** ppObject);
ULONG _stdcall AddRef();
ULONG _stdcall Release();
// Implementation
private:
CPtrArray m_arrTables; // Array of pointers to CStringArray (the "database")
CStringArray m_arrNames; // Array of table names
ULONG m_dwRefCount;
public:
CDB();
~CDB();
};
extern ULONG g_dwRefCount;
class CDBSrvFactory : public IClassFactory {
// Interface
public:
HRESULT _stdcall QueryInterface(REFIID riid, void** ppObject);
ULONG _stdcall AddRef();
ULONG _stdcall Release();
HRESULT _stdcall CreateInstance(IUnknown *pUnkOuter, REFIID riid, void** ppObject);
HRESULT _stdcall LockServer(BOOL fLock);
// Implementation
private:
ULONG m_dwRefCount;
public:
CDBSrvFactory();
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?