本文整理汇总了C++中CStringArray::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ CStringArray::GetData方法的具体用法?C++ CStringArray::GetData怎么用?C++ CStringArray::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringArray
的用法示例。
在下文中一共展示了CStringArray::GetData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SortExtensionData
void CDirstatDoc::SortExtensionData(CStringArray& sortedExtensions)
{
sortedExtensions.SetSize(m_extensionData.GetCount());
int i= 0;
POSITION pos= m_extensionData.GetStartPosition();
while (pos != NULL)
{
CString ext;
SExtensionRecord r;
m_extensionData.GetNextAssoc(pos, ext, r);
sortedExtensions[i++]= ext;
}
_pqsortExtensionData= &m_extensionData;
qsort(sortedExtensions.GetData(), sortedExtensions.GetSize(), sizeof(CString), &_compareExtensions);
_pqsortExtensionData= NULL;
}
示例2: AddToIEFav
void CFavMenu::AddToIEFav(HMENU fmenu, CString favpath, UINT &id)
{
static short menu_level = 0;
menu_level++;
favmenus.Add(fmenu);
CStringArray favs;
DWORD count = 0;
LPSTR pdata = NULL;
BYTE* data = NULL;
favs.SetSize(count, 64);
CFileFind finder;
BOOL found = finder.FindFile(favpath + "\\*.*");
while (found)
{
found = finder.FindNextFile();
if (!finder.IsDots() && !finder.IsHidden())
{
CString title = finder.GetFileTitle();
BOOL bdir = finder.IsDirectory();
CString item;
if (finder.IsDirectory())
{
//取得有"."的資料夾名稱 by NomedEmag 07/06/08
title = finder.GetFileName();
//
item = 'd' + title;
}
else
{
item = 'w' + title;
item += '\t';
CString ads;
DWORD retl = GetPrivateProfileString("InternetShortcut", "URL", "",
ads.GetBuffer(2048), 2048 , finder.GetFilePath());
ads.ReleaseBuffer();
item += ads;
}
favs.Add(item);
}
}
finder.Close();
if (data)
delete []data;
//利用特殊技巧 qsort,這是依賴 MFC 的內部實做方式,將來可能有變
if (AppConfig.autosort_favorite)
qsort(favs.GetData(), favs.GetSize(), sizeof(CString), FavItemCompare);
// long menuh=GetSystemMetrics(SM_CYMENU)*4+64;
// UINT id = ID_FIRST_WEB_FAVORITE;
int menu_height = 0;
for (int i = 0; i < favs.GetSize(); ++i)
{
if (!favs[i].IsEmpty())
{
web_fav.Add(favs[i]);
if ('d' == favs[i][0])
{
HMENU submenu = CreatePopupMenu();
AppendMenu(fmenu, MF_OWNERDRAW | MF_POPUP, (UINT)submenu, LPCTSTR(id), menu_height);
++id;
AddToIEFav(submenu, (favpath + '\\' + (LPCTSTR(favs[i]) + 1)), id);
}
else
{
AppendMenu(fmenu, MF_OWNERDRAW, id, LPCTSTR(id), menu_height);
++id;
}
}
}
web_fav.Add(sep);
++id;
::AppendMenu(fmenu, MF_SEPARATOR, 0, 0);
web_fav.Add(add_to_fav);
AppendMenu(fmenu, MF_OWNERDRAW, id/*ID_ADDTOFAVORITE*/, LPCTSTR(id), menu_height); id++;
web_fav.Add(open_all);
AppendMenu(fmenu, MF_OWNERDRAW, id/*ID_FAVORITE_OPENALL*/, LPCTSTR(id), menu_height); id++;
web_fav.Add(org_fav);
AppendMenu(fmenu, MF_OWNERDRAW, id/*ID_FAVORITE_EDIT*/, LPCTSTR(id), menu_height); id++;
menu_level--;
if (!menu_level)
{
web_fav.Add(add_to_home);
AppendMenu(fmenu, MF_OWNERDRAW, ID_ADDTOHOME, LPCTSTR(id), menu_height);
++id;
}
else
//.........这里部分代码省略.........