Solved

MapViewOfFile memory problem.

Posted on 2004-04-16
3
456 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
  • 2
3 Comments
 
LVL 16

Accepted Solution

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

Expert Comment

by:nonubik
ID: 10841082
0
 

Author Comment

by:pcssecure
ID: 10841123
Works. Thanks.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now