Click here to Skip to main content
15,886,518 members
Articles / Desktop Programming / ATL

Using MS DataGrid control with OLE DB consumer

Rate me:
Please Sign up or sign in to vote.
4.25/5 (8 votes)
22 Sep 20013 min read 189.5K   2.2K   37  
Use the MS DataGrid control in your C++ app with OLE DB Consumer Templates
// MSDataGridView.h : interface of the CMSDataGridView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MSDATAGRIDVIEW_H__13A66794_21A3_4576_B6BE_26BB09C19348__INCLUDED_)
#define AFX_MSDATAGRIDVIEW_H__13A66794_21A3_4576_B6BE_26BB09C19348__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CMSDataGridView : public CListView
{
protected: // create from serialization only
	CMSDataGridView();
	DECLARE_DYNCREATE(CMSDataGridView)

// Attributes
public:
	CMSDataGridDoc* GetDocument();
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMSDataGridView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMSDataGridView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CMSDataGridView)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in MSDataGridView.cpp
inline CMSDataGridDoc* CMSDataGridView::GetDocument()
   { return (CMSDataGridDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MSDATAGRIDVIEW_H__13A66794_21A3_4576_B6BE_26BB09C19348__INCLUDED_)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Kingdom United Kingdom
Was made redundant in early 2003 after 10 years in computer programming, since then started my own business (selling computer books on the net)
www.pricecutbook.co.uk


Comments and Discussions