Freeing Resources Used by a Multiline Edit Control

Last reviewed: June 12, 1995
Article ID: Q74224
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.1 and 3.0

An application developed for the Microsoft Windows graphical environment must explicitly free the resources that a multiline edit control uses in the following two situations:

  1. Before sending the edit control a EM_SETHANDLE message to change the text buffer, the application must first send a EM_GETHANDLE message to the control to obtain a handle to the existing buffer. When an application specifies a new text buffer, Windows does not automatically free the existing buffer. To prevent memory loss, the application must free the buffer by calling the LocalFree function.

  2. If an application creates a font object and uses the WM_SETFONT message to specify that an edit control should use that font, the application must call the DeleteObject function to delete the font object when it is no longer needed.


Additional reference words: 3.00 3.10
KBCategory: kbprg
KBSubcategory: UsrCtl


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 12, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.