|
//重载隐式转换操作符 operator ValueType() { assert(m_cObject != NULL); assert(Get != NULL); return (m_cObject->*Get)(); } private: Container* m_cObject; //属性的拥有者 void (Container::*Set)(ValueType value); //set函数指针 ValueType (Container::*Get)(); //get函数指针 }; class CAdoConnection { public: CAdoConnection(); ~CAdoConnection(); //隐式的转换操作,不推荐使用,只是暂时类没有封装好,给客户一个方便 //使用时请确保指针在类的生命期内使用 operator _ConnectionPtr(); public: CProperty<CAdoConnection, BOOL, READ_WRITE> Connected; string ConnectingString; string UserName, PassWord; private: void SetConnected(BOOL ConnectFlag); BOOL GetConnected(); private: _ConnectionPtr m_ptrConn; friend class CAdoCommand; friend class CAdoQuery; }; class CAdoCommand { public: CAdoCommand(); ~CAdoCommand(); void Execute(); operator _CommandPtr(); public: CommandTypeEnum CommandType; string CommandText; CAdoConnection * m_AdoConnection; private: _CommandPtr m_ptrComm; }; //CAdoConnection CAdoConnection::CAdoConnection() { Connected.setContainer(this);&nbs 上一页 [1] [2] [3] [4] [5] 下一页 [VB.NET程序]ADO 在informix的 Addnew [VB.NET程序]ADO 的测试 [VB.NET程序]ADO 揭密 1 [Web开发][ADO]如何修改ADO的线程模型 [Web开发]Delphi7下仿Ado.Net类的实现 [Web开发]通过COM使用ADO [Web开发]ADO & ADO.NET中使用存储过程的两个共用的函数 [Web开发]Binding a DataGrid to an ADO Recordset [Web开发]ADOCE for ADO Programmers [Web开发]Delphi多线程下的ADO编程
|