Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Assert in CXTShellListCtrlEx::OnLButtonDblClk
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Assert in CXTShellListCtrlEx::OnLButtonDblClk

 Post Reply Post Reply
Author
Message
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post Topic: Assert in CXTShellListCtrlEx::OnLButtonDblClk
    Posted: 30 January 2007 at 7:41pm
uploads/20070130_193936_ShellListTest.zip
 
Version 10.4.2
 
I am attaching source for a simple program that has a CXTShellTreeCtrl, a CXTShellListCtrlEx, and a CEdit control all on a CFormView.  If you double-click on folders in the list control you will get an ASSERT (in debug mode of course) within a few clicks because the m_strItemPath variable is empty.  Note that I am not using the View versions of the controls, like most of the CodeJock sample programs.
 
Also, I have the following questions,
  1. How are you to tell what the current path is of the tree and/or the list control?  I see a variable in the list control that should contain the path, but it is a protected member and doesn't have an accessor method.  I don't want to rely on a syncWnd to have the path text.
  2. In the tree control, I have the desktop as the root, but how do I initially select and expand the "Computer" folder?
  3. I have an Edit control on the form and I call m_ctrlList.SetSyncWnd( &m_ctrlEdit ), but it is never updated.  Should it be updated with the path?
Thanks,
Larry
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2007 at 1:10am
Hi,
Use

CXTShellListCtrl instread of CXTShellListCtrlEx.

 

Use tree.GetSelectedFolderPath(CString& strFolderPath); to get current path

Call SetRootFolder to change root folder.
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2007 at 11:27am

Thanks.  Changing from CXTShellListCtrlEx to CXTShellListCtrl does eliminate the ASSERT.  However, the call to SetRootFolder (CSIDL_DRIVES) has its own problems.  First, I had to call it before the tree was initialized, otherwise nothing happened.  Second, all of the icons in the tree are lost by doing this.

That is not a big deal for me because I want the desktop to be the root, which is the default.  I just need to figure out how to programmatically expand and select "Computer" so that the contents of "Computer" are initially displayed in the list control.  I don't want to rely on the string "Computer" since my program may be executed on machines using different languages.

Any ideas. 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.