Print Page | Close Window

Assert in CXTShellListCtrlEx::OnLButtonDblClk

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6274
Printed Date: 29 March 2024 at 11:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Assert in CXTShellListCtrlEx::OnLButtonDblClk
Posted By: larryp
Subject: Assert in CXTShellListCtrlEx::OnLButtonDblClk
Date Posted: 30 January 2007 at 7:41pm
https://forum.codejock.com/uploads/20070130_193936_ShellListTest.zip - 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
 



Replies:
Posted By: Oleg
Date 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


Posted By: larryp
Date 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. 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net