Click here to Skip to main content
15,894,410 members
Articles / Desktop Programming / MFC

Memory bitmap class CMemBm

Rate me:
Please Sign up or sign in to vote.
4.82/5 (9 votes)
23 Feb 2006 277.5K   9.3K   96  
A simple class to make generic Windows bitmap operations easier.
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

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

//avoid VS 2005 CRT deprecation messages
#define _CRT_SECURE_NO_DEPRECATE

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers

#ifndef _WIN32_WINDOWS		// Allow use of features specific to Win 98 or later
#define _WIN32_WINDOWS 0x0410
#endif

#include <afxwin.h>

#include <assert.h>
#ifndef NDEBUG
	#define M_ASSERT(x)	assert(x)
#else
	#define M_ASSERT(x)
#endif

// Windows Header Files:
#include <windows.h>

// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <math.h>

#include <string>
#include <vector>

// Local Header Files

// TODO: reference additional headers your program requires here

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

#if defined(_WIN32_WCE) && !defined(UNDER_CE)
	#define UNDER_CE _WIN32_WCE
#endif

#ifdef UNDER_CE
#if _WIN32_WCE < 0x500 && _MSC_VER > 1220 
// only needed for WM2003 builds under VS2005 
#pragma comment(lib, "ccrtrtti.lib") 
#endif
#endif

//undefine to use DDB functionality instead of DIB section
//#define MCH_USE_DDB

//define stubs for MChart - specific types to compile standalone
#define MByteString	std::string
#define M_NUMBER_OF_ARRAY_ELEMENTS(a)	(sizeof(a)/sizeof(a[0]))
#define M_L(x)	_T(x)
//stringer macro
#define MCH_TO_STRING_(x)			# x
#define MCH_TO_STRING(x)	MCH_TO_STRING_(x)

struct MException
{
public:
	MException( LPCTSTR strMsg ) : m_strMsg(strMsg) {}
	static void Throw( LPCTSTR strMsg ) { throw MException( strMsg ); }

	LPCTSTR GetMsg() const { return m_strMsg.c_str(); }

protected:
	typedef std::basic_string<TCHAR> StdStringT;
	StdStringT m_strMsg;
};

class MChNonCopyableConcept
{
protected:
	MChNonCopyableConcept() {}
	~MChNonCopyableConcept() {}

private:  
	MChNonCopyableConcept( const MChNonCopyableConcept& );
	const MChNonCopyableConcept& operator=( const MChNonCopyableConcept& );
};

//gdi wrappers
#include "MChGDIWrappers.h"
//membm
#include "MChMemBm.h"

#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__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
Software Developer (Senior) Eko-Sfera
Russian Federation Russian Federation
Born in 05.20.1971, in Moscow.
Graduated from Moscow Physical Engineering Institute in 1993.
Gained PhD. in Phys. Math. sciences in 1998.
Programmer experience over 8 years.
Assembler(s), Pascal, VBasic, JScript, ANSI C, C++.
Microcontrollers, Serial communication, MSJet DB, MFC, ATL, COM.
MSDev Studio, Borland CBuilder.
Russian, English.

Married, with one child.

Comments and Discussions