Click here to Skip to main content
13,770,106 members

Windows API

 
AnswerRe: Microsoft COM Pin
Richard Andrew x6412-Nov-15 4:12
professionalRichard Andrew x6412-Nov-15 4:12 
AnswerRe: Microsoft COM Pin
Eddy Vluggen12-Nov-15 4:25
professionalEddy Vluggen12-Nov-15 4:25 
AnswerRe: Microsoft COM Pin
Kunal Chowdhury «IN»4-Mar-16 0:01
mentorKunal Chowdhury «IN»4-Mar-16 0:01 
AnswerRe: Microsoft COM Pin
Munchies_Matt6-Apr-17 2:47
memberMunchies_Matt6-Apr-17 2:47 
QuestionClient Universall App WebApi Pin
Paolo Mazzon31-Oct-15 1:27
memberPaolo Mazzon31-Oct-15 1:27 
AnswerRe: Client Universall App WebApi Pin
Richard Deeming2-Nov-15 3:17
mvpRichard Deeming2-Nov-15 3:17 
GeneralRe: Client Universall App WebApi Pin
Paolo Mazzon2-Nov-15 19:52
memberPaolo Mazzon2-Nov-15 19:52 
QuestionUse CreatePrintAsyncNotifyChannel to communicate from Server Port to Client Driver Pin
Member 118933017-Aug-15 4:03
memberMember 118933017-Aug-15 4:03 
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 = TRUE;
pClientNotification->Release();
}
pIAsynchNotification->Release();
}

Code if printjob goes wrong:

pJobInfo2->Status = JOB_STATUS_ERROR;
SetJob( pIniPort->hPrinter, pIniPort->JobId, 2, (LPBYTE)pJobInfo2, JOB_CONTROL_DELETE );
QuestionWindows 8.1 Event log problem Pin
zeki yugnak24-Jun-15 4:32
memberzeki yugnak24-Jun-15 4:32 
AnswerRe: Windows 8.1 Event log problem Pin
Nitzan Levi22-Aug-15 23:11
memberNitzan Levi22-Aug-15 23:11 
GeneralRe: Windows 8.1 Event log problem Pin
Richard Andrew x6412-Nov-15 4:11
professionalRichard Andrew x6412-Nov-15 4:11 
GeneralRe: Windows 8.1 Event log problem Pin
Nitzan Levi12-Nov-15 8:51
memberNitzan Levi12-Nov-15 8:51 
QuestionTerminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 5:39
memberMc_Topaz26-May-15 5:39 
AnswerRe: Terminal: Schedule a program with main method arguments Pin
Richard Andrew x6426-May-15 6:35
professionalRichard Andrew x6426-May-15 6:35 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 9:11
memberMc_Topaz26-May-15 9:11 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Graham Breach26-May-15 23:14
memberGraham Breach26-May-15 23:14 
GeneralRe: Terminal: Schedule a program with main method arguments Pin
Mc_Topaz26-May-15 23:51
memberMc_Topaz26-May-15 23:51 
QuestionEasyhook error:STATUS_INVALID_PARAMETER_4:The given 32-Bit library does not exist!<Code: 2> Pin
Member 1159616813-May-15 18:10
memberMember 1159616813-May-15 18:10 
AnswerRe: Easyhook error:STATUS_INVALID_PARAMETER_4:The given 32-Bit library does not exist!<Code: 2> Pin
Frankie-C14-May-15 2:41
memberFrankie-C14-May-15 2:41 
QuestionMultiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
SRIVATHSAN VIJAYA21-Apr-15 0:17
memberSRIVATHSAN VIJAYA21-Apr-15 0:17 
AnswerRe: Multiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
Richard MacCutchan21-Apr-15 0:32
protectorRichard MacCutchan21-Apr-15 0:32 
AnswerRe: Multiple Client Support Server Application designed with Windows Named Pipes hangs frequently Pin
Frankie-C24-Apr-15 6:32
memberFrankie-C24-Apr-15 6:32 
QuestionPCI driver Pin
Member 115839296-Apr-15 3:04
memberMember 115839296-Apr-15 3:04 
Answer[REPOST] Re: PCI driver Pin
Sascha Lefèvre6-Apr-15 3:43
professionalSascha Lefèvre6-Apr-15 3:43 
QuestionC/C++ - Win32 : how can i find memory leaks? Pin
Member 1154582422-Mar-15 9:34
memberMember 1154582422-Mar-15 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web05-2016 | 2.8.181119.1 | Last Updated 10 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid