Getting the names of browser folders

Top  Previous  Next

Here is how to loop over browser folders and print out the name of each folder:

 

   // Get the root of the pane of browser folders

   CComPtr<BrowserNode> pTopNode;

   pCctPane->get_TopNode(&pTopNode);

 

   // Get the enumerator to loop over the browser folders...

   BrowserFoldersEnumeratorPtr SubFolders = pTopNode->GetBrowserFolders();

 

   gLogger.Printf(ekLogMsg, L"Create new pane folder, %d already exist\n", SubFolders->Count);

 

   // Loop over the browser folders...

   for (int f = 1; f <= SubFolders->Count; f++) {

 

       // Get the folder...

       BrowserFolderPtr BrowserPtr = SubFolders->GetItem(f);

 

       // Get its name and print it...

       CComBSTR cStr;

       BrowserPtr->get_Name(&cStr);

       CString csName(cStr);

       gLogger.Printf(ekLogMsg, L"Folder %03d is <%s>", f, csName);

   }

 

 

 

 

Enter topic text here.

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)