本文整理汇总了C++中CContainerUI::RemoveAll方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainerUI::RemoveAll方法的具体用法?C++ CContainerUI::RemoveAll怎么用?C++ CContainerUI::RemoveAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainerUI
的用法示例。
在下文中一共展示了CContainerUI::RemoveAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumInstalledDriver
void MainFrame::EnumInstalledDriver()
{
// 清空界面中list中显示的打印机列表
CContainerUI* pDriverList = static_cast<CContainerUI*>(paint_manager_.FindControl(_T("driver_list")));
if (pDriverList != NULL)
pDriverList->RemoveAll();
// 枚举本地计算机上所有安装的打印机驱动(实际使用时可以只枚举自家的打印机驱动)
LPBYTE lpBuffer = NULL;
DWORD dwNeeded = 0,dwReturned = 0;
EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 1, NULL, 0, &dwNeeded, &dwReturned);
if (dwNeeded == 0)
return;
lpBuffer = (LPBYTE)malloc(dwNeeded);
if (lpBuffer == NULL)
return;
EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 1, lpBuffer, dwNeeded, &dwNeeded, &dwReturned);
for (DWORD dwIndex = 0; (dwIndex < dwReturned) && (pDriverList != NULL); dwIndex++)
{
COptionUI* pDriver = new COptionUI();
if (pDriver != NULL)
{
pDriver->ApplyAttributeList(_T("padding=\"15,0,0,0\" height=\"35\" textpadding=\"20,0,0,0\" align=\"left\" normalimage=\"res='124' restype='png' dest='0,10,15,25'\" hotimage=\"res='125' restype='png' dest='0,10,15,25'\" selectedimage=\"res='126' restype='png' dest='0,10,15,25'\""));
pDriver->SetText(((PRINTER_INFO_1*)lpBuffer + dwIndex)->pName);
pDriverList->Add(pDriver);
}
}
LPTSTR lpDefaultPrinter;
GetDefaultPrinter(NULL, &dwNeeded);
lpDefaultPrinter = (LPTSTR)malloc(dwNeeded * sizeof(TCHAR));
GetDefaultPrinter((LPTSTR)lpDefaultPrinter, &dwNeeded);
free(lpDefaultPrinter);
free(lpBuffer);
}