Microsoft Developer Network >
Domovská stránka fór
>
XML Paper Specification (XPS)
>
XPS Sample Driver question
XPS Sample Driver question
- Hi,I am trying to modify xpsdrvsmpl to call another program shortly after the documentstarts to "print". Where would be the best place to place the CreateProcess or ShellExecutecall so that it only executes once? ThanksRandy
Odpovědi
- Hi!
You can to this in the User Interface DLL. see http://msdn.microsoft.com/en-us/library/bb734121.aspx with the DOCUMENTEVENT_STARTDOC event.
- Označen jako odpověďrjenovai 22. října 2009 18:01
- I got it to work after adding the following to DOCUMENTEVENT_QUERYFILTER:
I also made sure that piResult was not set as an unreferenced parameterif (pvOut) { DOCEVENT_FILTER* pFilter = (DOCEVENT_FILTER*)pvOut; pFilter->cElementsReturned = 6; pFilter->aDocEventCall[0] = DOCUMENTEVENT_ENDDOCPOST; pFilter->aDocEventCall[1] = DOCUMENTEVENT_STARTDOC; pFilter->aDocEventCall[2] = DOCUMENTEVENT_ENDDOC; pFilter->aDocEventCall[3] = DOCUMENTEVENT_STARTPAGE; pFilter->aDocEventCall[4] = DOCUMENTEVENT_ENDPAGE; pFilter->aDocEventCall[5] = DOCUMENTEVENT_XPS_ADDFIXEDDOCUMENTSEQUENCEPOST; *piResult = DOCUMENTEVENT_SUCCESS; ret = DOCUMENTEVENT_SUCCESS; } else { *piResult = DOCUMENTEVENT_UNSUPPORTED; ret = E_NOTIMPL; }
Once these were added, the STARTDOC, ENDDOC, etc.. events were fired in windows x64.- Označen jako odpověďrjenovai 22. října 2009 18:01
Všechny reakce
- Hi!
You can to this in the User Interface DLL. see http://msdn.microsoft.com/en-us/library/bb734121.aspx with the DOCUMENTEVENT_STARTDOC event.
- Označen jako odpověďrjenovai 22. října 2009 18:01
- This worked well until I tried to move my driver to 64-bit vista and windows 7. It appears that the STARTDOC and ENDDOC events
are not being called. Is this true and if so what can I do to workaround? Thanks
Randy - I got it to work after adding the following to DOCUMENTEVENT_QUERYFILTER:
I also made sure that piResult was not set as an unreferenced parameterif (pvOut) { DOCEVENT_FILTER* pFilter = (DOCEVENT_FILTER*)pvOut; pFilter->cElementsReturned = 6; pFilter->aDocEventCall[0] = DOCUMENTEVENT_ENDDOCPOST; pFilter->aDocEventCall[1] = DOCUMENTEVENT_STARTDOC; pFilter->aDocEventCall[2] = DOCUMENTEVENT_ENDDOC; pFilter->aDocEventCall[3] = DOCUMENTEVENT_STARTPAGE; pFilter->aDocEventCall[4] = DOCUMENTEVENT_ENDPAGE; pFilter->aDocEventCall[5] = DOCUMENTEVENT_XPS_ADDFIXEDDOCUMENTSEQUENCEPOST; *piResult = DOCUMENTEVENT_SUCCESS; ret = DOCUMENTEVENT_SUCCESS; } else { *piResult = DOCUMENTEVENT_UNSUPPORTED; ret = E_NOTIMPL; }
Once these were added, the STARTDOC, ENDDOC, etc.. events were fired in windows x64.- Označen jako odpověďrjenovai 22. října 2009 18:01

