本文整理汇总了C++中Printer::LookupService方法的典型用法代码示例。如果您正苦于以下问题:C++ Printer::LookupService方法的具体用法?C++ Printer::LookupService怎么用?C++ Printer::LookupService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Printer
的用法示例。
在下文中一共展示了Printer::LookupService方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsWindow
// Printer::EventHandler implementation
OSStatus
CSecondPage::OnAddPrinter(
uint32_t inInterfaceIndex,
const char * inName,
const char * inType,
const char * inDomain,
bool moreComing)
{
Printer * printer;
Service * service;
CPrinterSetupWizardSheet * psheet;
DWORD printerNameCount;
bool newPrinter = false;
OSStatus err = kNoErr;
check( IsWindow( m_hWnd ) );
m_browseList.SetRedraw(FALSE);
psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
require_quiet( psheet, exit );
printer = Lookup( inName );
if (printer == NULL)
{
try
{
printer = new Printer;
}
catch (...)
{
printer = NULL;
}
require_action( printer, exit, err = E_OUTOFMEMORY );
printer->window = this;
printer->name = inName;
err = UTF8StringToStringObject(inName, printer->displayName);
check_noerr( err );
printer->actualName = printer->displayName;
printer->installed = false;
printer->deflt = false;
printer->resolving = 0;
//
// Compare this name against printers that are already installed
// to avoid name clashes. Rename as necessary
// to come up with a unique name.
//
printerNameCount = 2;
for (;;)
{
PrinterNameMap::iterator it;
it = m_printerNames.find(printer->actualName);
if (it != m_printerNames.end())
{
printer->actualName.Format(L"%s (%d)", printer->displayName, printerNameCount);
}
else
{
break;
}
printerNameCount++;
}
newPrinter = true;
}
check( printer );
service = printer->LookupService( inType );
if ( service != NULL )
{
service->refs++;
}
else
{
try
{
service = new Service;
}
catch (...)
{
service = NULL;
}
require_action( service, exit, err = E_OUTOFMEMORY );
service->printer = printer;
service->ifi = inInterfaceIndex;
service->type = inType;
//.........这里部分代码省略.........