Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Use CreatePrintAsyncNotifyChannel to communicate from Server Port to Client Driver

Use CreatePrintAsyncNotifyChannel to communicate from Server Port to Client Driver

Scheduled Pinned Locked Moved Windows API
comsysadminxmlhelptutorial
1 Posts 1 Posters 11 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11859851
    wrote on last edited by
    #1

    I am developing a printer driver. Now i have to communicate the error from server to driver. I will explain step for step. The printer is installed on the printserver and is shared to the client. This client gets the driver from the server and works fiine. Now one applicatioin from client prints some document from the server. The printjob arrives on the server and is managed by the print monitor on the server. Anything goes wrong. How to get the errormessage to the client? Or any errormessage to the client? If the printer is installed locale on the client, i use CreatePrintAsyncNotifyChannel to create the error-message-ballon on the desktop. But if i am a shared printer i get no baloonmassage on Client nor on the server. So how to communicate from server to client. Code for the balloning: IPrintAsyncNotifyChannel *pIAsynchNotification = NULL; CreatePrintAsyncNotifyChannelProc pfnIPC = (CreatePrintAsyncNotifyChannelProc)GetProcAddress(hWinSpoolDrv, "CreatePrintAsyncNotifyChannel"); if (pfnIPC != NULL) { HRESULT hr = pfnIPC( cPrinterName, const_cast<GUID*>(&MS_ASYNCNOTIFY_UI), kPerUser, kUniDirectional,// kBiDirectional, // NULL, &pIAsynchNotification ); DWORD dwErr = HRESULT_CODE(hr); if (pIAsynchNotification) { wchar_t cMessageBody[2048] = L"<?xml version=\"1.0\" ?>"\ L"<asyncPrintUIRequest xmlns=\"http://schemas.microsoft.com/2003/print/asyncui/v1/request\\">"\\ L"<v1><requestOpen><balloonUI><title>"; wcscat_s(cMessageBody,cPrinterName); wcscat_s(cMessageBody,L"</title><body>"); wcscat_s(cMessageBody,cErrMsg); wcscat_s(cMessageBody,L"</body></balloonUI></requestOpen></v1></asyncPrintUIRequest>"); CPrintOEMAsyncNotifyDataObject *pClientNotification = new CPrintOEMAsyncNotifyDataObject(reinterpret_cast<BYTE*>(cMessageBody), sizeof(cMessageBody), const_cast<GUID*>(&MS_ASYNCNOTIFY_UI)); if (pClientNotification) { pIAsynchNotification->SendNotification(pClientNotification); bErrorSend =

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups