get_subfolder_count not returning correct count of subfolders under a folder

Oct 15, 2010 at 3:01 AM
Edited Oct 15, 2010 at 3:43 AM

Hello,

I'm trying to get subfolder count for a folder in a pst using get_subfolder_count() and it is not returning me the right value. When I looked at the sdk, it looks like that it is reading the property below -

0x36030003  PR_CONTENT_UNREAD				PidTagContentUnreadCount

This doesn't seem to be a subfolder count property. I even tried 0x6638 which is PR_FOLDER_CHILD_COUNT but this property doesn't exist in property bag. Any idea how to get the correct subfolder count?

here's my code -

folder fSub = m_pstStore->open_folder(nidFolder);
for(folder::folder_iterator fIter = fSub.sub_folder_begin(); fIter != fSub.sub_folder_end(); ++fIter)
{
contentCount = fIter->get_message_count();
subfolderCount = fIter->get_subfolder_count();

Thanks.

Coordinator
Oct 15, 2010 at 7:17 PM

You're right; that method is named wrong. It's right next to the get_message_count() method too..

The best way to get the subfolder count looks like myfold.get_hierarchy_table().size(), and get_subfolder_count() should be implemented as such. Thanks for reporting the issue!

Oct 15, 2010 at 11:44 PM

Perfect. I was trying this property directly 0x663e0003 (PR_HIERARCHY_CHANGE_NUM) but read_prop didn't return anything. Forgot to check that there's a function call get_hierarchy_table

Thanks much.