我找了帮助,仔细看看。用new创建的对象,是分配在heap中的,必须delete;用create()创建的
是分配在stack中的,绘自动销毁。
If you create a CEdit object within a dialog box, the CEdit object is automatically destroyed when the user closes the dialog box.
If you create a CEdit object from a dialog resource using the dialog editor, the CEdit object is automatically destroyed when the user closes the dialog box.
If you create a CEdit object within a window, you may also need to destroy it. If you create the CEdit object on the stack, it is destroyed automatically. If you create the CEdit object on the heap by using the new function, you must call delete on the object to destroy it when the user terminates the Windows edit control. If you allocate any memory in the CEdit object, override the CEdit destructor to dispose of the allocations.