Click here to Skip to main content
15,893,594 members
Articles / Desktop Programming / MFC

The Ultimate Toolbox - Updates and User Contributions

Rate me:
Please Sign up or sign in to vote.
4.79/5 (26 votes)
12 Feb 2013CPOL8 min read 255.9K   23.7K   170  
Updates and User Contributions for the Ultimate Toolbox Libraries
#ifndef __BINDING_CLASSES
#define __BINDING_CLASSES


class Column 
{
protected:
	void*		m_buffer;
	DWORD		m_Length;
	DBSTATUS	m_Status;
	ULONG		m_iOrdinal;
	LONG		m_MaxLength;
	DBTYPE		m_Type;
	BYTE		m_Precision;
	BYTE		m_Scale;

	CString		m_colName;
	BOOL		m_Dirty;

public:
	// ctor & dtor
	Column ();
	virtual ~Column();
	// operations
	const CString& ColumnName() const
		{ return m_colName; }
	DBTYPE Type() const
		{ return m_Type; }
	BOOL GetDirty()
		{ return m_Dirty; }
	void SetDirty(BOOL dirty)
		{ m_Dirty=dirty; }

	BOOL SetBinding(DBCOLUMNINFO* pColInfo);
	BOOL GetBinding(DBBINDING* pDBBind, long baseAddress);



	CString ToString() const;
	BOOL FromString(const CString& str);
};


class Columns
{
protected:
	Column*	m_cols;
// v7.2 - update 02 - 64-bit
#if _MSC_VER < 1400
	ULONG			m_NumCols;
#else 
	DBORDINAL		m_NumCols;
#endif

public:
	Columns() : m_cols(NULL), m_NumCols(0)
		{}
	~Columns();
	HRESULT SetColumnInfo(IColumnsInfo* pIColumnsInfo);
	HRESULT SetColumnBindings(DBBINDING** ppBinds, ULONG* cBound);
	HRESULT SetDirtyColumnBindings(DBBINDING** ppBinds, ULONG* cBound);

	// v7.2 - update 02 - 64-bit - added cast here
	int GetNumCols()
		{ return (int)m_NumCols; }

	Column* operator[](int nIndex);
	void* BaseAddress()
		{ return (void*) &m_cols[0]; }

};

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions