Click here to Skip to main content
15,896,154 members
Articles / General Programming / Threads

A Standard Multi-threaded Dynamic Queue

Rate me:
Please Sign up or sign in to vote.
4.79/5 (24 votes)
28 Oct 2010GPL36 min read 152.2K   5.6K   111  
This is a standard Windows / C++ implementation of a multi-threaded queue.
// StandardQueuesDlg.h : header file

#pragma once

#include "afxcmn.h"
#include "afxwin.h"

#include "TabCtrlEx.h"

#include "TabMultiThreadQueue.h"
#include "TabCircBufferQueue.h"
#include "TabDoubleBuffer.h"

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

// Dialog Data
	enum { IDD = IDD_STANDARDQUEUES_DIALOG };

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

private:
   CTabMultiThreadQueue* m_pMultiThreadQueueDlg;
   CTabCircBufferQueue*  m_pCircBufferDlg;
   CTabDoubleBuffer*     m_pDoubleBufferDlg;

protected:
   CTabCtrlEx m_TabbedMainCtrl;
   CStatic m_StaticPlaceHolder;

protected:
   bool AddDialog(UINT nIDTemplate, CDialog* pDialog, LPTSTR lpczLabel);
   void ShowDialog(CDialog* pDialog);

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
   afx_msg void OnBnClickedCancel();
   virtual BOOL DestroyWindow();
   afx_msg void OnBnClickedOk();
};

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 GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
Italy Italy
Senior Software Developer in C/C++ and Oracle.
Ex-physicist holding a Ph.D. on x-ray lasers.

Comments and Discussions