Click here to Skip to main content
15,897,187 members
Articles / Programming Languages / C++

CRC_32

Rate me:
Please Sign up or sign in to vote.
4.50/5 (9 votes)
9 Oct 2001CPOL3 min read 148.9K   5.5K   55  
A class that implements the CRC-32 Cyclic Redundancy Check Algorithm (MultiThreaded with Progress Bar support)
// CRCThreadDlg.h : header file
//

#if !defined(AFX_CRCTHREADDLG_H__3E1791C8_BBE3_11D5_B625_8E0C44DE9921__INCLUDED_)
#define AFX_CRCTHREADDLG_H__3E1791C8_BBE3_11D5_B625_8E0C44DE9921__INCLUDED_

#include "CRC_32.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "FileEditCtrl.h"
#include "TextProgressCtrl.h"

/////////////////////////////////////////////////////////////////////////////
// CCRCThreadDlg dialog

class CCRCThreadDlg : public CDialog
{
// Construction
public:
	CRC_32 m_CRC_32;
	DWORD Running;
	HANDLE Thread1;
	HANDLE Thread2;
	CCRCThreadDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CCRCThreadDlg)
	enum { IDD = IDD_CRCTHREAD_DIALOG };
	CButton	m_Check1;
	CButton	m_Ok;
	CTextProgressCtrl	m_progress2;
	CTextProgressCtrl	m_progress1;
	CFileEditCtrl	m_edit2;
	CFileEditCtrl	m_edit1;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCRCThreadDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CCRCThreadDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnOK();
	//}}AFX_MSG
	afx_msg void OnChangeEdit(UINT nID);
    afx_msg void OnCRCThreadDone(WPARAM, LPARAM);
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_CRCTHREADDLG_H__3E1791C8_BBE3_11D5_B625_8E0C44DE9921__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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
President
Canada Canada
Father of two, brother of two, child of two.
Spouse to one, uncle to many, friend to lots.
Farmer, carpenter, mechanic, electrician, but definitely not a plumber.
Likes walks with the wife, board games, card games, travel, and camping in the summer.
High school graduate, college drop-out.
Hobby programmer who knows C++ with MFC and the STL.
Has dabbled with BASIC, Pascal, Fortran, COBOL, C#, SQL, ASM, and HTML.
Realized long ago that programming is fun when there is nobody pressuring you with schedules and timelines.

Comments and Discussions