Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How toopen needed branch in GUI_Explorer?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How toopen needed branch in GUI_Explorer?

 Post Reply Post Reply
Author
Message
ksiva View Drop Down
Newbie
Newbie
Avatar

Joined: 04 August 2005
Location: Russian Federation
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ksiva Quote  Post ReplyReply Direct Link To This Post Topic: How toopen needed branch in GUI_Explorer?
    Posted: 04 August 2005 at 3:52pm
How to open needed branch in GUI_Explorer at start time when the particular brach is put to command line?
 
I use GUI_Explorer example. Really it is very similar to explorer.exe.
I want to add some functionality. I want make it work as explorer.
 
When you run explorer with command line parameter then it uses parameter as folder or disk name to browse in the left tree. For example "explorer.exe z:\folder" opens in the tree the corresponding branch of disk Z:. So I want to do the same.
 
But I stuck there. When I add parameter to command line then MFC takes this parameter as the event that user wants to open a document. So when it process ProcessShellCommand function it calls CDocument::OnOpenDocument()  and I should change tree position here. (Or not?)  I tried to do it and called GetParentFrame()->m_TreeCtrl.TunnelTree(lpszPathName)&nbs p; but it fails on ASSERT inside MFC. I tried some different places but again I get ASSERT falure. Looks like CShellListCtrl is not in memory or something else.
 
How to make CShellListCtrl position to the needed place?
 
Now it uses "My documents" folder to start from.
 
Is it right place CDocument::OnOpenDocument() to control CShellListCtrl?
 
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: 05 August 2005 at 11:38pm

1. use PopulateTree

PopulateTree(lpszPathName);

bvut check if m_TreeCtrl.GetSafeHwnd() not NULL in CDocument::OnOpenDocument. Don';t think it is right pace.

2: in 9.70 was added m_TreeCtrl.SetRootFolder(nRootFolder)

try SetRootFolder(CSIDL_PERSONAL) in constructor of m_TreeCtrl

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ksiva View Drop Down
Newbie
Newbie
Avatar

Joined: 04 August 2005
Location: Russian Federation
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ksiva Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2005 at 9:41am
Thanks.
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.047 seconds.