MemTrack
Requirements:
- Visual C++ 6.0
- Windows CE Toolkit for Visual C++ 6.0
Steps to add MemTrack to an MFC project:
- Open MemTrack.dsw with Visual C++ 6.0. From the Projects menu, select Batch Build and
Rebuild All. This will build MemTrack for the windows CE 2.11 emulator in both DEBUG and
RELEASE modes, and copy MemTrackd.dll and MemTrack.dll into the emulator's directory.
- For convenience, copy MemTrack.h, MemTrack.lib and MemTrackd.lib into a common
directory, such as C:\MemTrack.
- Close the MemTrack project and open an MFC project of yours.
- Add #include <MemTrack.h> as the last
include file in Stdafx.h.
- Replace any occurrence of ::new and ::delete by new
and delete respectively.
- Add the directory where MemTrack.h resides (see Step 2) in the project settings: from
the Projects menu, select Settings and then C/C++; select Preprocessor from the Category
combo box, and add the path under "Additional include directories".
- Add the directory where MemTrack.lib and MemTrackd.lib resides (see Step 2) in the
project settings: still within the Projects Settings dialog box, select the Link tab, and
Input from the Category combo box; then add the path under "Additional library
path".
- Rebuild the project (i.e. Rebuild All from the Projects menu) in DEBUG mode and run it
(in the emulator).
- Any memory leak will be dumped in the Output window. Double-clicking on each line
describing a leak will open the file and position the cursor on the related line. Note
that since some objects are allocated in applications but released in the MFC library,
some memory leaks will always be detected.
- You can also build your project in RELEASE mode, in which case a single message box will
be displayed upon termination if memory leaks are detected.
Enjoy!
Send comments to: jeangareau@yahoo.com