<\/p>\n\r
The Handles menu is a convenient way to allocate and free Win32 resource handles and track the events in Memory Validator.<\/p>\n\r
<\/p>\n\r
Leaks are created by creating but not freeing each type of resource below.<\/p>\n\r
<\/p>\n\r
The thread creation and thread deletion examples can test the detection of cross thread allocation<\/a>.<\/p>\n\r <\/p>\n\r <\/p>\n\r <\/p>\n\r<\/td>\n\r <\/p>\n\r •<\/span>Start a thread and allocate some memory in it to be deallocated below <\/span><\/p> •<\/span>Stop the thread<\/p> •<\/span>The deallocation will happen from a different<\/span> thread to the one that allocated.<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Allocate a device context <\/span><\/p> •<\/span>Deallocate it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Get a device context using GetDC()<\/span> <\/span><\/p> •<\/span>Release it using ReleaseDC()<\/span> <\/span><\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Open a file. If the file is not closed the file handle will be leaked. <\/span><\/p> •<\/span>Close it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create a font <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create a pen <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create a brush <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create an icon <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create a mouse cursor <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create a window <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create a bitmap <\/span><\/p> •<\/span>Destroy it<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Extract an icon from a bitmap <\/span><\/p> •<\/span>Destroy the icon<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Test the lifetime of a temporary CDC object <\/span><\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Map a view of a file into memory <\/span><\/p> •<\/span>Unmap the view<\/p><\/td>\n\r<\/tr>\n\r <\/p>\n\r<\/td>\n\r •<\/span>Create some regions using CreateRectRgn(),<\/span>one of which leaks <\/span><\/p> •<\/span>See CTeststakView<\/span>::<\/span>OnRegionTests<\/span>()<\/span><\/p><\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r <\/p>\n\r <\/p>\n\r The More Handles menu is...well, more of the same - i.e. convenient ways to create different types of handles and oberve the events in Memory Validator.<\/p>\n\r <\/p>\n\r <\/p>\n\r <\/p>\n\r<\/td>\n\r <\/p>\n\r •<\/span>Create some Timer Queue and Timer handles - see CTeststakView<\/span>::<\/span>OnTimerQueueTests<\/span>()<\/span> <\/span><\/p> <\/p>\n\r •<\/span>Create and MFC CFile<\/span> object, write to it and then close it.<\/p><\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r <\/p>\n\r <\/p>\n\r <\/p>\n\r"
})
\n\r
\n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r \n\r <\/span><\/h1>\n\r
<\/a>The More Handles menu<\/span><\/h1>\n\r
<\/span><\/h1>\n\r
\n\r
\n\r