Click here to Skip to main content
15,881,588 members
Articles / Desktop Programming / WTL

A fast and lightweight cell control

Rate me:
Please Sign up or sign in to vote.
4.42/5 (31 votes)
11 Mar 2008CPOL1 min read 90.8K   4.5K   81  
A fast and lightweight cell control for displaying tabular data. The cell is a custom control derived from ATL::CWindow.
#pragma once
#include <comdef.h>
namespace misc{
	inline void TESTHR(HRESULT hr){
		if FAILED(hr){
			IErrorInfo* pEI;
			GetErrorInfo(0,&pEI);
			throw _com_error(hr,pEI);
		}
	}

	//BOOL _com_error_msg(_com_error& e,LPCTSTR file=__FILE__,int linenum=__LINE__,bool bShowcontinue=false,BSTR bstrDesc=0,bool bShowCheck=false);
	class ComErrorMsg
	{
#ifdef _DEBUG
		const char* m_file;
		int m_line;
#endif
	public:
		ComErrorMsg( const char* file, int line)
#ifdef _DEBUG
			:m_file( file ),
			  m_line( line )
#endif
		  {
		  }
		  BOOL operator()(_com_error& e,bool bShowcontinue=false,BSTR bstrDesc=0,bool bShowCheck=false);
	};
}//namespace misc;
#define _COM_ERROR_MSG_ (misc::ComErrorMsg( __FILE__, __LINE__ ))

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
China China
My name is Yanxueming,i live in Chengdu China.Graduated from UESTC in 1999.

Comments and Discussions