IPrinterQueue::SendBidiQuery() RRS feed

  • Question

  • Can someone tell me how to implement this in a C++ Metro app? I need to ultimately query for the \Printer.DeviceInfo:NetworkingInfo.IPAddress.


    So far....

    I've authored a Device Metadata package, and I have the code below. There are 2 problems up to now. The 1st is IPrinterExtensionContext is an "undeclared identifier". What do I need to include to resolve this reference? And the 2nd is, if I comment out the last 2 lines in the try block, the FromDeviceId() call throws a Platform:AccessDeniedException. id="\\?\SWD#PRINTENUM#{F346C2E3-9B77-4833-9742-E16BA238CBC3}#{0ecef634-6ef0-472a-8085-5ad023ecbccd}"

    try { Platform::String^ id = m_deviceInfo->Id; Platform::Object^ printContext = Windows::Devices::Printers::Extensions::PrintExtensionContext::FromDeviceId(id); IPrinterExtensionContext^ printerContext = (IPrinterExtensionContext^)printContext; printerContext->PrinterQueue->SendBidiQuery("Printer.DeviceInfo:NetworkingInfo.IPAddress"); } catch (Exception^ ex) { }

    Tuesday, March 6, 2012 10:17 PM


All replies

  • I'll track someone down to look into this for you.

    David Lamb

    Thursday, March 8, 2012 1:27 AM
  • David - I've resolved both of these issues, thanks.
    Friday, March 9, 2012 5:26 PM
  • Hi Sparksteam,

    I have associated a USB connected printer to a Windows Store device app. I have created the meta data and I am able to enumerate the associated device . PrintExtensionContext::FromDeviceId() method throws the same exception(ACCESS_DENIED) for me. Looks like, the issue is similar..Hope you have solved the issue in your case. Could you please share how you solved the issue?

    • Edited by its_me_here Tuesday, July 23, 2013 11:54 AM To ask a question
    Tuesday, July 23, 2013 11:49 AM