?
Solved

MapViewOfFile memory problem.

Posted on 2004-04-16
3
Medium Priority
?
465 Views
Last Modified: 2013-11-20
Hi,

    When calling MapViewOfFile (in winXP environment) repeatedly, Is it normal for the address of the return pointer to keep increasing?

E.g.

m_BmpBits = MapViewOfFile( m_MMFBmpBits, FILE_MAP_ALL_ACCESS, 0, 0, m_BmpSize);


The start address denoted by m_BmpBits keeps increasing when this line is executed repeatedly. When I check the memory usage of the application, it is increased with each iteration.

Do I need to free any memory?

Thanks.
0
Comment
Question by:pcssecure
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 2000 total points
ID: 10841060
You need to call UnmapViewOfFile(m_BmpBits) for each MapViewOfFile.
0
 

Author Comment

by:pcssecure
ID: 10841123
Works. Thanks.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question