Click here to Skip to main content
13,297,799 members (47,589 online)
Click here to Skip to main content


82 bookmarked
Posted 6 Nov 2001

Shared memory

, 28 Sep 2002
Share variables in the shared memory across processes
// TestSMDlg.h : header file

#if !defined(AFX_TESTSMDLG_H__73FE91AA_ACB1_11D4_9B42_00AA0066B154__INCLUDED_)
#define AFX_TESTSMDLG_H__73FE91AA_ACB1_11D4_9B42_00AA0066B154__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "SharedMemory.h"

// CTestSMDlg dialog

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

// Dialog Data
	CButton	m_CBtnTestExch;
	CButton	m_CBtnIncr;
	CButton	m_CBtnExchAdd;
	CButton	m_CBtnExch;
	CButton	m_CBtnDecr;
	CButton	m_CBtnCmpExch;
	CButton	m_CBtnWaiForVar;
	CListCtrl	m_SharedMemView;
	CButton	m_CBtnSetVal;
	CButton	m_CbtnRefr;
	CButton	m_CBtnDel;
	CButton	m_CbtnAdd;
	CString	m_CsUsedSize;
	CString	m_CsMemorySize;
	CString	m_CsTotalUsage;
	CString	m_CsVariablesCount;

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

// Implementation
	HICON m_hIcon;
	CSharedMemory *m_psm;

	void UpdateButtonsState(int pos);

	// 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 OnAdd();
	afx_msg void OnDel();
	afx_msg void OnRefr();
	afx_msg void OnSetval();
	afx_msg void OnDblclkSharedmemory(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnWaitForChange();
	afx_msg void OnWaitForMem();
	afx_msg void OnItemclickSharedmemory(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnClickSharedmemory(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKeydownSharedmemory(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnCompareexchange();
	afx_msg void OnDecrement();
	afx_msg void OnExchange();
	afx_msg void OnExchangeadd();
	afx_msg void OnIncrement();
	afx_msg void OnRead();
	afx_msg void OnTestexchange();
	afx_msg void OnWrite();
	afx_msg void OnWaitformultivarchange();

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

#endif // !defined(AFX_TESTSMDLG_H__73FE91AA_ACB1_11D4_9B42_00AA0066B154__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.


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


About the Author

Martin Ziacek
Software Developer (Senior)
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 29 Sep 2002
Article Copyright 2001 by Martin Ziacek
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid