void XFE_FolderDropdown::syncFolderList() { MSG_Master *master = fe_getMNMaster(); int num_infos; if (m_infos) delete [] m_infos; /* this should be the number of MSG_FolderInfo's for mail, including servers. */ num_infos = MSG_GetFoldersWithFlag(master, MSG_FOLDER_FLAG_MAIL, NULL, 0); if (m_showNewsgroups) { num_infos += MSG_GetFoldersWithFlag(master, MSG_FOLDER_FLAG_NEWSGROUP, NULL, 0); m_numNewsHosts = MSG_GetFoldersWithFlag(master, MSG_FOLDER_FLAG_NEWS_HOST, NULL, 0); num_infos += m_numNewsHosts; } m_numinfos = num_infos; m_infos = new MSG_FolderInfo* [num_infos]; int pos = 0; /* build the default mail tree */ buildList(NULL, &pos); /* now we build each newshost */ if (m_numNewsHosts > 0) { MSG_FolderInfo **news_hosts; int i; news_hosts = new MSG_FolderInfo* [m_numNewsHosts]; MSG_GetFoldersWithFlag(master, MSG_FOLDER_FLAG_NEWS_HOST, news_hosts, m_numNewsHosts); for (i = 0; i < m_numNewsHosts; i++) buildList(news_hosts[i], &pos); delete [] news_hosts; } DD(printf("\nold m_numinfos = %d new numinfos %d\n", m_numinfos, pos);)
BOOL CCustomHeadersDlg::OnInitDialog() { CDialog::OnInitDialog(); MSG_FolderInfo *pInbox = NULL; MSG_GetFoldersWithFlag (WFE_MSGGetMaster(), MSG_FOLDER_FLAG_INBOX, &pInbox, 1); uint16 numItems; MSG_GetNumAttributesForFilterScopes (WFE_MSGGetMaster(), scopeMailFolder, (void**)&pInbox, 1, &numItems); MSG_SearchMenuItem * pHeaderItems = new MSG_SearchMenuItem [numItems]; if (!pHeaderItems) return FALSE; //something bad happened here!! MSG_GetAttributesForFilterScopes (WFE_MSGGetMaster(), scopeMailFolder, (void**)&pInbox, 1, pHeaderItems, &numItems); for (int i=0; i < numItems; i++) { if ( (pHeaderItems[i].attrib == attribOtherHeader) && pHeaderItems[i].isEnabled ) { m_lbHeaderList.AddString(pHeaderItems[i].name); } } delete pHeaderItems; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }