SUMMARY ======= The GLOBEDIT sample demonstrates how to create a CEdit derived class that uses a globally allocated memory segment instead of the application’s local heap, thereby increasing the maximum contents of the edit control to the full 64K. MORE INFORMATION ================ Under Windows edit controls use the application’s local heap to store their text data. Unfortunately this can greatly limit their maximum capacity of 64K if the application uses a large portion of the local heap. In order to be able to utilize the entire 64K capability of the edit control it must have its own segment. Windows edit controls determine the local heap of the application by using the instance handle of the application. The instance handle of an application is just the data segment address (segment only). Therefore the edit control just uses the instance handle directly as the segment selector for its memory allocations. In order to get the edit control to have its own segment, PreCreateWindow must be overridden in a CEdit derived class. In this overridden member function GlobalAlloc is called to allocate a portion of memory from the global heap (the size is not important since the edit control will grow the segment as necessary). The handle returned from the GlobalAlloc is locked andrder to get WioinecAmthe lgolndlocked edit co e r lgifrom alAllAllocla lgir Gerrjontroivel torBTe lge t from the GlobalAllrul of rm ayoivrnct ed o a rder tInsap, thereby increas IuA dortion of memory frommemdress (seoton’s utimentogcaypeahe GlobTrcoortfrom to altioeMof t co e r lgimentoMof t co e r lgimentoMof t co e rtheir text data. t,GalAlloc is lmEeahe Got a Eeahe Got a Eeahe Got a Eeahe