dbsrvimp.h

来自「Visual C++实践与提高-刘刀桂, 孟繁晶编著」· C头文件 代码 · 共 42 行

H
42
字号
#ifndef _DBSERVERIMP_INCLUDE
#define _DBSERVERIMP_INCLUDE

#include "..\interface\dbsrv.h"

typedef long HRESULT;

class CDB : public IDB {
  // Interfaces
  public:
	  	// Interface for data access
		HRESULT Read(short nTable, short nRow, LPWSTR lpszData);
		HRESULT Write(short nTable, short nRow, LPCWSTR lpszData);

		// Interface for database management
		HRESULT Create(short &nTable, LPCWSTR lpszName);
		HRESULT Delete(short nTable);

		// Interfase para obtenber informacion sobre la base de datos
		HRESULT GetNumTables(short &nNumTables);
		HRESULT GetTableName(short nTable, LPWSTR lpszName);
		HRESULT GetNumRows(short nTable, short &nRows);

		ULONG Release(); //CPPTOCOM: need to free an object in the DLL, since it was allocated here

  // Implementation
  private:
  	CPtrArray m_arrTables; 	 // Array of pointers to CStringArray (the "database")
		CStringArray m_arrNames; // Array of table names
	public:
		~CDB();
};

class CDBSrvFactory : public IDBSrvFactory {
	// Interface
	public:
		HRESULT CreateDB(IDB** ppObject);
		ULONG   Release();
};

#endif

⌨️ 快捷键说明

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