Click here to Skip to main content
11,922,641 members (59,564 online)
Click here to Skip to main content


161 bookmarked

Concurrency Runtime in Visual C++ 2010

, 11 Nov 2010 CPOL
Learn about parallel algorithms, parallel containers, tasks, task groups, agents library, task scheduler etc in VC10
// CR MFC AppDlg.h : header file

#pragma once
#include "afxwin.h"

// CCRMFCAppDlg dialog
class CCRMFCAppDlg : public CDialogEx
// Construction
	CCRMFCAppDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data

	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedBtnSum();
	// Captures what is in IDC_SUM_TO editbox
	CEdit m_cSumTill;
	CListBox m_cOutList;


	// Perform parallel tasks in separate thread
	// Performing in another thread as NO correlation
	// with CR. Just to make sure UI gets updated, and doesn't freeze
	static UINT PerformParallelSum(void*);	// Thread
	void ParallelSumProc();			// Actual routine

	static UINT PerformParallelPrimeFind(void*);	// Thread
	void ParallelPrimeFindProc();			// Actual routine

	static UINT PerformParallelInvoke(void*);	// Thread
	void ParallelInvokeProc();			// Actual routine

	afx_msg void OnEnSetfocusSumTo();
	afx_msg void OnEnSetfocusPrimeTo();
	afx_msg void OnBnClickedBtnPrime();
	void EnableControls( BOOL bEnable );
	CEdit m_cPrimeTill;
	afx_msg void OnBnClickedBtnTasks();

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

Ajay Vijayvargiya
Software Developer (Senior)
India India
Started programming with GwBasic back in 1996 (Those lovely days!). Found the hidden talent!

Touched COBOL and Quick Basic for a while.

Finally learned C and C++ entirely on my own, and fell in love with C++, still in love! Began with Turbo C 2.0/3.0, then to VC6 for 4 years! Finally on VC2008/2010.

I enjoy programming, mostly the system programming, but the UI is always on top of MFC! Quite experienced on other environments and platforms, but I prefer Visual C++. Zeal to learn, and to share!

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151125.1 | Last Updated 12 Nov 2010
Article Copyright 2010 by Ajay Vijayvargiya
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid