// JP opened flex table

Click to See Complete Forum and Search --> : Splitter containing a TreeView with TVS_EDITLABELS set: debug assertion failed when editing


Patricia Avigdor
June 25th, 1998, 11:54 AM
I have a splitter window included inside a CScrollView.

This static splitter window contains a CTreeView set with TVS_EDITLABELS.

When I start to edit a label in the TreeCtrl, the label is selected and I get the input focus. If I click again inside the text control, OnEndLabelEdit gets called and then I get a debug assertion failed. Normal behaviour would be that OnEndLabelEdit shouldn't be called and the label selection should just disappear (that's what happens in Windows Explorer).

If I click outside of the text label, OnEndLabelEdit gets called and no problem.

If I type characters no problem either.


What I've seen so far is that on the second click, OnActivateView is first called on the ScrollView. This disactivates the TreeView and I suppose calls OnEndLabelEdit. Then OnActivateView is called for the TreeView (too late).


Does anybody have an idea of what's wrong and how to work around this problem?


Thanks for your help,

Pat

Andy Howe
July 10th, 1998, 09:40 PM
I just spent time debugging the same problem in a list control, but I believe the problem is the same in the tree control. What I did to fix it is to make sure that I called SetActivePane on the splitter window class before the label is edited.

Patricia Avigdor
July 15th, 1998, 12:14 PM
Hello Andy,


Thanks for the answer.

But at which moment exactly do you call SetActivePane?

I tried to put it in the BeginEditLabel but it doesn't change anything.

Should I put it in the EndEditLabel or in the LButtonClick?


Thanks for your help,

Pat

//JP added flex table