I have created a CTreeCtrl in my dialog box. Using the EditLabel function of CTreeCtrl, I will allow the user to edit the selected item's text.

When the EditLabel function is called, the CTreeCtrl will begin in place editing of the selected item's text. The editing is accomplished by replacing the text of the item with a single line edit control containing the text. The user is thus able to change the text within the edit control. However when the user left mouse clicks on the edit control, the whole program will crash. Is there anyway to solve this problem?