From: Metroickha on
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

From: Tim Roberts on
Metroickha <Metroickha(a)discussions.microsoft.com> wrote:
>
>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, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: Metroickha on
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

"Tim Roberts" wrote:

> Metroickha <Metroickha(a)discussions.microsoft.com> wrote:
> >
> >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, timr(a)probo.com
> Providenza & Boekelheide, Inc.
> .
>
From: Tim Roberts on
Metroickha <Metroickha(a)discussions.microsoft.com> wrote:
>
>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?

>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, timr(a)probo.com
Providenza & Boekelheide, Inc.