Click here to Skip to main content
15,882,152 members
Articles / Desktop Programming / MFC

Threads with MFC

Rate me:
Please Sign up or sign in to vote.
4.38/5 (71 votes)
1 Feb 200313 min read 447.7K   21.4K   166  
Multithreading Programming with a MFC environment.
// Threads.h : main header file for the THREADS application
//

#if !defined(AFX_THREADS_H__FD617454_1520_401D_9D9A_8F021E336709__INCLUDED_)
#define AFX_THREADS_H__FD617454_1520_401D_9D9A_8F021E336709__INCLUDED_

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

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif
#define RUNNING true
#define END false
#include "resource.h"		// main symbols
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

/////////////////////////////////////////////////////////////////////////////
// CThreadsApp:
// See Threads.cpp for the implementation of this class
//

class CThreadsApp : public CWinApp
{
public:
	
	void PaintEndLine(COLORREF winersColor);
	//COLORREF m_winersColor;
	bool m_winner;
	void CreateFilesForSlidersPosition();
	bool m_SpeakerEnable;
	void Initialize();
	bool m_Thread5_LoopType;
	bool m_Thread4_LoopType;
	bool m_Thread3_LoopType;
	bool m_Thread2_LoopType;
	bool m_Thread1_LoopType;
	time_t m_ThreadsActivationTime;
	time_t m_ThreadsCreationTime;
	bool m_ThreadsState;
	int m_shift5;
	int m_shift4;
	int m_shift3;
	int m_shift2;
	int m_shift1;
	CThreadsApp();
//Setting an array of Thraeds pointers
	CWinThread* m_pThreads[5];
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CThreadsApp)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL

// Implementation

	//{{AFX_MSG(CThreadsApp)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

extern CThreadsApp theApp;
/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_THREADS_H__FD617454_1520_401D_9D9A_8F021E336709__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
Denmark Denmark
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions