From: Floyd on
I've created a printer driver based off the Bitmap sample in the LDK. It
basically sends bitmap data to a separate processing DLL. When installing it
via the INF, I create a new Local Port and it works great. When I create a
port using the AddPort() or AddPortEx() API, the port is created but nothing
gets printed.
When using the port created by the API, I get the OEMStartDoc, followed by
the OEMDisablePDEV. With a port created through the Add Printer Wizard, I
get the whole shebang.
Any ideas on how to create the port programatically? Thanks.

--
Floyd
From: Debabrata Sarma[MSFT] on
Are you using Longhorn OS to test this code?

Does this code work in XP OS?

If it is a Longhorn issue, then you should post your question to whatever
Longhorn Beta
Newsgroup name provided.

Have you called AddPrinter to associate the port to the printer?

Thanks.

Deba Sarma
MICROSOFT DDK Print Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
From: Floyd on
Deba,
Thanks for responding. I'm trying to install a printer based on the LDK
on XP.
What I want to do is create a port using the AddPort or AddPortEx methods
that is identical to the port created through the Add Printer Wizard. For
some reason, the ports that I'm creating are not the same as the ports
created through the wizard.
I'm using Delphi for the installation code creating the port. The
PORT_INFO_2 structure is set to:
pPortName = "MyPort";
pMonitorName = "Local Port";
pDescription = "description";
fPortType = PORT_TYPE_READ;

AddPortEx returns success, and the "MyPort" is listed in EnumPorts. The
PORT_INFO_2 for MyPort is identical to the other ports created manually
through the wizard. The only difference is that when my printer is
associated with MyPort I don't get the printer data, and when it's associated
with a manually created port it works.

Thanks.

--
Floyd


"Debabrata Sarma[MSFT]" wrote:

> Are you using Longhorn OS to test this code?
>
> Does this code work in XP OS?
>
> If it is a Longhorn issue, then you should post your question to whatever
> Longhorn Beta
> Newsgroup name provided.
>
> Have you called AddPrinter to associate the port to the printer?
>
> Thanks.
>
> Deba Sarma
> MICROSOFT DDK Print Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights
From: Floyd on
Problem solved. Someone had installed a "MyPort" TCP/IP port on this system
previously. I guess that there were some residual references to the TCP/IP
port somewhere. Changing the name of the port makes it all better. Thanks.
--
Floyd


From: Debabrata Sarma[MSFT] on
Use AddPort function, AddPortEx is obsolete.

Try also using the XP DDK to build your application and see if it works.

Thanks.

Deba Sarma
MICROSOFT DDK Print Developer Support

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