Discussion:
Drvlineto doesn't get called
(too old to reply)
Metroickha
2010-06-24 14:47:06 UTC
Permalink
Hello,

I have a question regarding the MSPlot sample of the WinDDK. In this sample
the function drvlineto is not implemented. I've implemented the drvlineto to
the hooktable in the enable.c, then I also added the hookflag HOOK_LINETO to
the flags. I implemented the function DrvLineTo(...).

But when I call the lineto function in MFC the function doesn't get triggered.

Somewhere I read I needed to select a solid pen with 0 width, I've tried it
but it doesn't work.

The driver does build successfully. I installed the driver. The driver gets
loaded through the CDC.createDC(...). But when I call CDC.LineTo(...) while
debugging with WinDBG, the function doesn't get hooked. Why? Does anyone
knows?

Kind regards,

Chi Wai
Tim Roberts
2010-06-26 04:27:48 UTC
Permalink
Post by Metroickha
I have a question regarding the MSPlot sample of the WinDDK. In this sample
the function drvlineto is not implemented. I've implemented the drvlineto to
the hooktable in the enable.c, then I also added the hookflag HOOK_LINETO to
the flags. I implemented the function DrvLineTo(...).
But when I call the lineto function in MFC the function doesn't get triggered.
Somewhere I read I needed to select a solid pen with 0 width, I've tried it
but it doesn't work.
Do you implement DrvStrokePath? If so, GDI will turn all line calls into
calls to DrvStrokePath.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Metroickha
2010-06-28 09:05:43 UTC
Permalink
Thanks for your replies mr Robers!

DrvStrokePath is already implemented with the sample. I did try to remove
its implementation. But still drvlineto seems not to work.

While debugging I noticed that 'EnableSurface' doesn't get called. Is this
because there is not physical plotter connected to the computer?

When I setup the printer in Print-to-file mode it drvlineto gets called
sometimes.
Besides that it crashes the spooler-service in Windows 7, not in XP. When I
put the printer to LTP-mode it doesn't crash the spooler-service, but it
doesn't call anything as 'EnableSurface' doesn't get called. The last
function it calls is 'CompletePDev'.

So it seems that the hooks do not associate with the createsurface. What can
I do?
Implement the function body of 'EnableSurface' in 'CompletePDEV'?

Kind regards,

Chi Wai
Post by Tim Roberts
Post by Metroickha
I have a question regarding the MSPlot sample of the WinDDK. In this sample
the function drvlineto is not implemented. I've implemented the drvlineto to
the hooktable in the enable.c, then I also added the hookflag HOOK_LINETO to
the flags. I implemented the function DrvLineTo(...).
But when I call the lineto function in MFC the function doesn't get triggered.
Somewhere I read I needed to select a solid pen with 0 width, I've tried it
but it doesn't work.
Do you implement DrvStrokePath? If so, GDI will turn all line calls into
calls to DrvStrokePath.
--
Providenza & Boekelheide, Inc.
.
Tim Roberts
2010-06-30 05:12:31 UTC
Permalink
Post by Metroickha
DrvStrokePath is already implemented with the sample. I did try to remove
its implementation. But still drvlineto seems not to work.
While debugging I noticed that 'EnableSurface' doesn't get called. Is this
because there is not physical plotter connected to the computer?
How are you installing your driver? There must have been SOMETHING to
trigger your installation -- even a virtual plotter. GDI doesn't care
whether there's a real device, as long as there is something to talk to.

How are you testing your printing?
Post by Metroickha
So it seems that the hooks do not associate with the createsurface. What can
I do?
Implement the function body of 'EnableSurface' in 'CompletePDEV'?
No, that's no good. You can't create the surface until GDI asks you to do
so. Tell me about your installation, and we'll go from there.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Loading...