Microsoft KB Archive/118876

= PRB: USER Resource Leak when Improperly Using CFormView =

Article ID: 118876

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 1.0 Professional Edition

 Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition</li></ul>

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.1</li></ul>

 Microsoft Visual C++ 4.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q118876

<div class="symptoms_section">

SYMPTOMS
If a menu is specified for the dialog-box template of a CFormView, then a permanent USER resource leak occurs.

<div class="cause_section">

CAUSE
A CFormView object uses a dialog-box template with a child style. It is not valid for a child window to have a menu. If a menu is specified for a child window, the menu will be created when the template is created but it will not be attached to the CFormView and it will therefore not be destroyed when the CFormView object is destroyed.

<div class="resolution_section">

RESOLUTION
Make sure none of the dialog-box templates for your CFormView objects have menus specified for them. To assist in this endeavor, starting with Visual C++, 32-bit Edition, version 4.0, the Dialog Editor will disable the Menu option on the Dialog Properties dialog box if the loaded dialog template has the Child style (WS_CHILD).

<div class="moreinformation_section">

MORE INFORMATION
If you are still encountering the resource leak, there are several other articles in the Knowledge Base that discuss possible causes:

71455 Tracking Down Lost System Resources

66654 Possible Causes for System Resource Reduction

72236 Maximizing the Use of Available Memory in Windows

Additional query words: 1.00 1.50 1.51 1.52 2.00 2.10 2.50 2.51 2.52 3.00 3.10 4.00 kbNoUpdate

Keywords: kbdocview kbprb KB118876

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.