Naughter Software Logo

CMemMapFile LogoCMemMapFile v1.67 A C++ class to encapsulate Memory Mapped Files

Memory mapping is a powerful mechanism Win32 provides to implement shared memory and also to access files though a simple memory pointer without having to implement your own home brewed buffering mechanisms. As an example its as simple as calling

void* lpData = mmf.Open();
CharUpperBuff(static_cast<LPSTR>(lpData), dwFileLength);

to convert a file to upper case.

Areas where you might find this of interest include very large database files with fixed records, audio processing, string operations and image processing.

The other side of memory mapped files is to implement shared memory. As you will probably know, Win32 puts each process into its own address space, thus making it impossible to pass ordinary pointers across process boundaries. With memory mapped files you get back this very useful mechanism.

The enclosed zip file contains the CMemMapFile source code and a simple dialog based application which demonstrates all the functionality of the class. For further details about the example program have a look at the BOOL CTestmemmapApp::InitInstance() function and the CDialog1 member functions both in testmemmap.cpp

 

Copyright

 

Updates

v1.67 (15 February 2022)

v1.66 (26 March 2020)

v1.65 (16 March 2020)

v1.64 (15 September 2019)

v1.63 (21 April 2019)

v1.62 (1 September 2018)

v1.61 (8 June 2018)

v1.60 (3 June 2018)

.59 (18 December 2015)

v1.58 (26 January 2014)

v1.55 (25 November 2012)

v1.57 (16 March 2012)

v1.56 (15 March 2012)

v1.54 (20 November 2011)

v1.53 (6 July 2009)

v1.52 (16 August 2008)

v1.51 (7 July 2006)

v1.50 (2 May 2006)

v1.49 (30 April 2005)

v1.48 (23 December 2004)

v1.47 (6 June 2004)

v1.46 (17 November 2003)

v1.45 (5 October 2003)

v1.44 (4 April 2001)

v1.43 (7 March 2001)

v1.42 (24 March 2000)

v1.41 (21 April 1999)

v1.4 (30 March 1999)

v1.3 (22 October 1998)

v1.2 (29 May 1998)

v1.1 (20 April 1998)

v1.0 (31 March 1998)