Naughter Software Logo

CMemMapFile LogoCMemMapFile v1.59 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.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)