Discussion:
capturing PS output in IPrintOemPS2::WritePrinter
(too old to reply)
jvilar
2010-06-15 17:25:43 UTC
Permalink
Raw Message
I extended the oemps sample driver implementing the IPrintOemPS2 interface.
After adding the two new methods and modifying the QueryInterface to expose
also the new interface, the method IPrintOemPS2::WritePrinter is called only
once with all arguments set to zero. I return S_OK in order to indicate that
the method is implemented as commented in the documentation, but the method
is not called any more.

Should I do something else in addition to this to capture the pscript's
output?

Thanks in advance
jvilar
2010-06-16 07:44:05 UTC
Permalink
Raw Message
more info:

If I return E_NOTIMPL from IPrintOemPS2::WritePrinter, then the pscript
driver sends the expected ps data to the spooler bypassing the
IPrintOemPS2::WritePrinter method. If I return S_OK instead, then the method
is only called once with all arguments set to zero and nothing arrives to the
spooler.
Post by jvilar
I extended the oemps sample driver implementing the IPrintOemPS2 interface.
After adding the two new methods and modifying the QueryInterface to expose
also the new interface, the method IPrintOemPS2::WritePrinter is called only
once with all arguments set to zero. I return S_OK in order to indicate that
the method is implemented as commented in the documentation, but the method
is not called any more.
Should I do something else in addition to this to capture the pscript's
output?
Thanks in advance
e***@gmail.com
2013-08-21 02:29:37 UTC
Permalink
Raw Message
Post by jvilar
I extended the oemps sample driver implementing the IPrintOemPS2 interface.
After adding the two new methods and modifying the QueryInterface to expose
also the new interface, the method IPrintOemPS2::WritePrinter is called only
once with all arguments set to zero. I return S_OK in order to indicate that
the method is implemented as commented in the documentation, but the method
is not called any more.
Should I do something else in addition to this to capture the pscript's
output?
Thanks in advance
Over 3 years later and I'm seeing this same thing. If someone has an answer or more info, please post it here as this is what turns up from Google searching on the subject "writeprinter not called". I'm only seeing this on Win7, not XP. On XP it works correctly.
e***@gmail.com
2013-08-21 03:55:46 UTC
Permalink
Raw Message
Post by e***@gmail.com
Post by jvilar
I extended the oemps sample driver implementing the IPrintOemPS2 interface.
After adding the two new methods and modifying the QueryInterface to expose
also the new interface, the method IPrintOemPS2::WritePrinter is called only
once with all arguments set to zero. I return S_OK in order to indicate that
the method is implemented as commented in the documentation, but the method
is not called any more.
Should I do something else in addition to this to capture the pscript's
output?
Thanks in advance
Over 3 years later and I'm seeing this same thing. If someone has an answer or more info, please post it here as this is what turns up from Google searching on the subject "writeprinter not called". I'm only seeing this on Win7, not XP. On XP it works correctly.
Resolved my issue. I was using a port name that I had been using with a port monitor in some earlier testing. The port monitor DLL wasn't even installed, so the printer was setup to use a port with a port monitor that was "broken". I removed the port monitor from the registry, so that Windows would no longer attempt to use it. After that, everything started working correctly. WritePrinter is now called several times, allowing me to capture all PS data -- no port monitor required!
Loading...