Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Introduces RSS Reader by AgileInfoSoftware

, 2 Dec 2003
This article introduces an application to consume RSS Feed from Internet.
agilereader_demo.zip
bin
AgileReader.exe
AgileReader.mdb
agilereader_src.zip
AgileReader.clw
AgileReader.dsp
AgileReader.dsw
AgileReader.exe
AgileReader.mdb
Release
res
AgileReader.ico
AgileReaderDoc.ico
bitmap1.bmp
ReaderImage.bmp
Toolbar.bmp
AgileReader
AgileReader.dsp
AgileReader.dsw
AgileReader.vcproj.vspscc
bin
AgileReader.exe
AgileReader.mdb
res
AgileReader.ico
AgileReaderDoc.ico
bitmap1.bmp
ReaderImage.bmp
Toolbar.bmp
// AgileReaderView.cpp : implementation of the CAgileReaderView class
//

#include "stdafx.h"
#include "AgileReader.h"

#include "AgileReaderDoc.h"
#include "AgileReaderView.h"
#include "ListCtrlSortClass.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAgileReaderView

IMPLEMENT_DYNCREATE(CAgileReaderView, CListView)

BEGIN_MESSAGE_MAP(CAgileReaderView, CListView)
	//{{AFX_MSG_MAP(CAgileReaderView)
	ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
	ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CListView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CListView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CListView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAgileReaderView construction/destruction

CAgileReaderView::CAgileReaderView()
{
	// TODO: add construction code here

}

CAgileReaderView::~CAgileReaderView()
{
}

BOOL CAgileReaderView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CListView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAgileReaderView drawing

void CAgileReaderView::OnDraw(CDC* pDC)
{
	CAgileReaderDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

void CAgileReaderView::OnInitialUpdate()
{
	CListView::OnInitialUpdate();


	// TODO: You may populate your ListView with items by directly accessing
	//  its list control through a call to GetListCtrl().
}

/////////////////////////////////////////////////////////////////////////////
// CAgileReaderView printing

BOOL CAgileReaderView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CAgileReaderView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CAgileReaderView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CAgileReaderView diagnostics

#ifdef _DEBUG
void CAgileReaderView::AssertValid() const
{
	CListView::AssertValid();
}

void CAgileReaderView::Dump(CDumpContext& dc) const
{
	CListView::Dump(dc);
}

CAgileReaderDoc* CAgileReaderView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAgileReaderDoc)));
	return (CAgileReaderDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAgileReaderView message handlers

void CAgileReaderView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) 
{
	GetParentFrame()->SendMessage( WM_LISTDCLICK );	
	*pResult = 0;
}

/////////////////////////////////////////////////////////////////////////////
// Sort Column
//
void CAgileReaderView::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	
	if (pNMListView->iSubItem == m_nSortListItem)
	{
		m_bSortListAsc = !m_bSortListAsc;
	}
	else
	{
		m_nSortListItem = pNMListView->iSubItem;
		m_bSortListAsc = TRUE;
	}

	// Sort list
	CListCtrlSortClass sc(&GetListCtrl(), m_nSortListItem);
	switch ( m_nSortListItem )
	{
		case 5:
			sc.Sort(m_bSortListAsc, CListCtrlSortClass::SortDataType::dtDATETIME);
			break;
		default:
			sc.Sort(m_bSortListAsc, CListCtrlSortClass::SortDataType::dtSTRING);
			break;
	}

	*pResult = 0;
}

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

Share

About the Author

li@agileinfollc.com
Web Developer
United States United States
LI is a architect of several database-centric tools and technologies. He has been programming since 1995. He is a Microsoft Certified Solution Developer (MCSD), MCSD.NET, SCJP, SCJD and OCDBA.
 
His programming experience includes C/C++, C#, MFC, ASP, VB and Perl. He has worked on Solaris, AIX, HPUX and various Windows, and found Windows is the easiest one to work with.
 
He has over 8 years of database experiences in Oracle, SQL Server, DB2 and other DBMS.
 
LI co-founded AgileInfoSoftware LLC (http://www.agileinfollc.com) in 2003. He is responsible for the overall vision and development strategy of the company.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 3 Dec 2003
Article Copyright 2003 by li@agileinfollc.com
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid