Click here to Skip to main content
12,953,541 members (51,979 online)
Click here to Skip to main content


36 bookmarked
Posted 10 Feb 2004

XBitArray - a non-MFC C++ class to manipulate bits in a bit array.

, 10 Feb 2004 CPOL
XBitArray provides functions to set, test, and find bits in an array of bytes.
// XBitArrayTestDlg.h : header file


#include "XListbox.h"
#include "XBitArray.h"

// CXBitArrayTestDlg dialog

class CXBitArrayTestDlg : public CDialog
// Construction
	CXBitArrayTestDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	CXListBox	m_List;

	// ClassWizard generated virtual function overrides
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
	void CreateBitFile(LPCTSTR lpszFile, DWORD dwSizeBytes, BOOL bit_value);
	int RunTest(CXBitArray& bit, int testnumber);
	int RunTest2(CXBitArray& bit, int testnumber);
	int RunTest3(int testnumber);
	int RunTest4(int testnumber);
	int RunTest5(int testnumber);

	HICON m_hIcon;
	int m_nErrors;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnTest();

// Microsoft Visual C++ will insert additional declarations immediately before the previous 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.


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


About the Author

Hans Dietrich
Software Developer (Senior) Hans Dietrich Software
United States United States
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.

Recently, I have moved to Los Angeles where I am doing consulting and development work.

For consulting and custom software development, please see

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 10 Feb 2004
Article Copyright 2004 by Hans Dietrich
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid