Question about DrvDocumentEvent

HI All :slight_smile:

I want to make a popup window for authentication with every print job.
So I was trying to use “DrvDocumentEvent” hook up. I’m using w2k.

so i read documents in DDK and MSDN, and some articles from here.
after then, i thought that i should make a printer
interface DLL which implements my own routine for DrvDocumentEvent.

This means i was trying to Write a wrapper for unidrvui.
So i tried to edit the example UI source in DDK samples.

in “/NTDDK/src/print/oemdll” there is ‘oemui’ directory
where the printer UI source code exists.
i first edited the “OEMUI.def” file and add the line
“DrvDocumentEvent” at the EXPORT paragraph.
and i added my own routine for the DrvDocumentEvent
function in “interface.cpp”

the build command was successful. and then i copied
the “OEMUI.dll” with print driver(the dirver dll was
hpdjres.dll which is for hp printers), installed with .inf
file which i made. I thought it would work.
because there was changes in the property windows.

I tried to make a MessageBox when DOCUMENTEVENT_STARTDOC
occurs but it didn’t work.
i also tried to make a log file when same event occurs,
but it didn’t work. :frowning:
I think my routine isn’t being called. but the other OEMUI
com interfaces worked.

Am i editing the wrong file?
or is there any missing procedure?

All i’ve done was exporting the function DrvDocumentEvent
and adding my routine in “interface.cpp”.

How can I make my implementation for DrvDocumentEvent called from
the system? how can i export it?

I read that DrvDocumentEvent is called from user-mode GDI client.

And if i use this function, does it works same at network printing
environment?

thanx for reading,
i’ll be looking forward for answers.

-with respect
Souneil Park

The oemui sample is an interface plug-in and *not* a wrapper. So
modifying it to implement DrvDocumentEvent is not going to work. In
order to implement DrvDocumentEvent on W2K, you will have to write a
complete UI dll that acts as a wrapper. So you will basically have all
the entry points that are required in an interface dll. But in the
implementation of these functions, all you will do is a GetProcAddress
on the corresponding unidrvui function and punt the call. The only
function that will have any real implementation will be
DrvDocumentEvent.

This approach is necessary only for W2K since the hook for
DrvDocumentEvent was not provided. On XP, you can write a UI plug-in
like the oemui sample and implement the IPrintOemUI2::DocumentEvent
callback function.

  • Ashwin

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Souneil Park [mailto:xxxxx@team.oz.or.kr]
Sent: Monday, August 19, 2002 2:32 AM
To: NT Developers Interest List
Subject: [ntdev] Question about DrvDocumentEvent

HI All :slight_smile:

I want to make a popup window for authentication with every print job.
So I was trying to use “DrvDocumentEvent” hook up. I’m using w2k.

so i read documents in DDK and MSDN, and some articles from here. after
then, i thought that i should make a printer interface DLL which
implements my own routine for DrvDocumentEvent.

This means i was trying to Write a wrapper for unidrvui.
So i tried to edit the example UI source in DDK samples.

in “/NTDDK/src/print/oemdll” there is ‘oemui’ directory
where the printer UI source code exists.
i first edited the “OEMUI.def” file and add the line
“DrvDocumentEvent” at the EXPORT paragraph.
and i added my own routine for the DrvDocumentEvent
function in “interface.cpp”

the build command was successful. and then i copied
the “OEMUI.dll” with print driver(the dirver dll was
hpdjres.dll which is for hp printers), installed with .inf
file which i made. I thought it would work.
because there was changes in the property windows.

I tried to make a MessageBox when DOCUMENTEVENT_STARTDOC
occurs but it didn’t work.
i also tried to make a log file when same event occurs,
but it didn’t work. :frowning:
I think my routine isn’t being called. but the other OEMUI
com interfaces worked.

Am i editing the wrong file?
or is there any missing procedure?

All i’ve done was exporting the function DrvDocumentEvent
and adding my routine in “interface.cpp”.

How can I make my implementation for DrvDocumentEvent called from the
system? how can i export it?

I read that DrvDocumentEvent is called from user-mode GDI client.

And if i use this function, does it works same at network printing
environment?

thanx for reading,
i’ll be looking forward for answers.

-with respect
Souneil Park


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%