Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtTreeCtrl and TVN_ENDLABELEDIT message Collapse All
Subject Author Date
Daniel Verret Aug 3, 2009 - 12:37 PM

I have a CExtTreeCtrl derived class  which is created with the TVS_EDITLABELS style.


I am unable to get the TVN_ENDLABELEDIT notification message when I stop editing the label.


The following notification message handling works well with a CTreeCtrl but not with a CExtTreeCtrl:


ON_NOTIFY_REFLECT(TVN_ENDLABELEDIT, OnTvnEndlabeledit)


Any idea how to fix it?


 


Thank you.

Daniel Verret Jan 10, 2011 - 7:52 AM

When I paste text in a tree item label, the GetItemData crash.  HTREEITEM seems valid:


 


void CMyCode::OnInplaceControlComplete( __EXT_MFC_SAFE_LPCTSTR strEditedText, bool bEditingLabel )

{

    if(bEditingLabel)

    {

        HTREEITEM hEditedItem = CExtTreeCtrl::GetInPlaceEditedItem();

        DWORD_PTR = GetItemData(hEditedItem);


 


Any Idea how to fix it?

Technical Support Jan 11, 2011 - 7:49 AM

The CExtTreeCtrl::OnInplaceControlComplete() method sends a TVN_ENDLABELEDIT notification and invokes the GetInPlaceEditedItem() without any assertion failures. Could you provide the call stack listing?

Daniel Verret Jan 11, 2011 - 1:50 PM

     mfc80ud.dll!CTreeCtrl::GetItemData(_TREEITEM * hItem=0x01d1e820)  Line 733 + 0x2f bytes    C++

>    CrowdWaysd.exe!CIdentitiesNavTree::OnInplaceControlComplete(const wchar_t * strEditedText=0x08e047f8, bool bEditingLabel=true)  Line 1083 + 0xc bytes    C++

     ProfUIS289ud.dll!02d557a6()    

     [Frames below may be incorrect and/or missing, no symbols loaded for ProfUIS289ud.dll]   

     mfc80ud.dll!AfxCallWndProc(CWnd * pWnd=0x08e03440, HWND__ * hWnd=0x00761240, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0)  Line 240 + 0x1c bytes    C++

     mfc80ud.dll!AfxWndProc(HWND__ * hWnd=0x00761240, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0)  Line 389    C++

     mfc80ud.dll!AfxWndProcBase(HWND__ * hWnd=0x00761240, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0)  Line 411 + 0x15 bytes    C++


 

Technical Support Jan 12, 2011 - 8:10 AM

The call stack listing is not detailed. We tried to reproduce the problem using the Tree View dialog page in the ProfUIS_Controls sample application. We modified the following method:

void CPageTreeCtrl::OnEndlabeleditTree1(NMHDR* pNMHDR, LRESULT* pResult) 
{
HTREEITEM hEditedItem = m_wndTree.GetInPlaceEditedItem();
DWORD_PTR a_data = m_wndTree.GetItemData( hEditedItem );
    a_data;


TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
    pTVDispInfo;
    *pResult = 1;
}
We cannot reproduce the problem.
Of course, it’s not recommended to set a break point to the first line. It’s also not recommended to display modal dialogs and message boxes while processing tree item’s label editing result.

Technical Support Aug 4, 2009 - 1:53 AM

The CExtTreeCtrl control does not use the built-in label editor of the Windows tree view common control. You should override the CExtTreeCtrl::OnInplaceControlComplete() virtual method. If the bEditingLabel parameter is true, then the label editing is finished and the CExtTreeCtrl::GetInPlaceEditedItem() method should be used for retrieving the HTREEITEM handle of edited item. Otherwise, the attached control is deactivated. The attached control is the extended feature of the CExtTreeCtrl class which allows you to show controls of several types after the label text. Please do not forget to invoke the parent class method finally.

Daniel Verret Aug 4, 2009 - 7:20 AM

It works just fine now, thank you for your quick answer!