本文整理汇总了C++中CButeMgr::GetTags方法的典型用法代码示例。如果您正苦于以下问题:C++ CButeMgr::GetTags方法的具体用法?C++ CButeMgr::GetTags怎么用?C++ CButeMgr::GetTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButeMgr
的用法示例。
在下文中一共展示了CButeMgr::GetTags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tmain
//.........这里部分代码省略.........
CFile file;
if (!file.Open(lpszButeFilename, CFile::modeCreate | CFile::modeNoTruncate))
{
printf("Error: Unable to open the file: %s\r\n", lpszButeFilename);
return 1;
}
file.Close();
}
// Initialize ButeMgr
CButeMgr buteMgr;
buteMgr.Init(MessageDisplay);
// Parse the file
if (!buteMgr.Parse(lpszButeFilename))
{
return 1;
}
// Indicate that properties are being added
printf("Adding properties...\r\n");
// Get the classes
int nClasses=cb_GetNumClassDefs(hModule);
ClassDef **pClasses=cb_GetClassDefs(hModule);
// Go through each class
int i;
for (i=0; i < nClasses; i++)
{
// This turns to TRUE once a property for this class has been added
BOOL bClassAdded=FALSE;
// Get the class name
const char *lpszClassName=pClasses[i]->m_ClassName;
CString sTagName;
sTagName.Format("%s", lpszClassName);
// Check to see if the description exists
if (!buteMgr.Exist(sTagName, "ClassDescription"))
{
// Add the description
buteMgr.SetString(sTagName, "ClassDescription", "");
// Display that this was added
if (!bClassAdded)
{
printf("\r\n[%s]\r\n", sTagName);
bClassAdded=TRUE;
}
printf("ClassDescription\r\n");
}
// Add the properties
AddClassProperties(pClasses[i], sTagName, bClassAdded, buteMgr);
}
// Get the tags in the bute file
CStringArray tagArray;
buteMgr.GetTags(GetTagsCallback, (void *)&tagArray);
// This indicates if the old tag header has been printed
BOOL bOldTagHeader=FALSE;
// Find the classes that are in the bute file but aren't in the object.lto file
for (i=0; i < tagArray.GetSize(); i++)
{
BOOL bFound=FALSE;
// Search the classes
int n;
for (n=0; n < nClasses; n++)
{
if (tagArray[i] == pClasses[n]->m_ClassName)
{
bFound=TRUE;
break;
}
}
// Print out the name if it hasn't been found
if (!bFound)
{
// Print the old tag header if needed
if (!bOldTagHeader)
{
printf("\r\nThese classes do not exist in the object.lto file:\r\n");
bOldTagHeader=TRUE;
}
printf("%s\r\n", tagArray[i]);
}
}
// Save the bute file
buteMgr.Save();
printf("\r\nSuccess!\r\n");
return 0;
}