Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows API to Create a New Printer port.

Posted on 2004-04-05
8
Medium Priority
?
459 Views
Last Modified: 2012-06-27
I need to create a custom Printer Port to connect a network printer to.  Are there any API's that can help me accomplish this?
0
Comment
Question by:Rowdyone52
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10757125
Take a look at this EE Post:
http://experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20455055.html

That should send you in the correct direction.

-Brian
0
 
LVL 4

Expert Comment

by:JpmSoft
ID: 10768032
If you want to create a "CUSTOM" printer port just like a "LPR Port", VB won't work for you... you should write some C++ Code.

Take a look at this...
http://www.codeguru.com/Cpp/W-P/printing/article.php/c5893/

Here you will find a very usefull source code for a 100% complete Printer Port. Actually this code redirect the output of the printer to an Specific folder using as file name the document name. So, all you have to do is work on the specific network communication protocol to "send" each job to the printer instead of a file...

Have you decided wich protocol are you going to use for this?
I can recommend LPR (RFC 1179)...

Good Luck!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Rowdyone52
ID: 10768051
I have no idea what protocol to use.  Anything that can connect to a Network Printer.  Could you please give me more info on that connection.

Thanks
GregR
0
 
LVL 4

Expert Comment

by:JpmSoft
ID: 10768265
The easiest way of sending jobs to a printer is thru 9100 port.

All you have to do is open a TCP/IP Connection to the Printer IP Address on port 9100...
Once you are connected, you just have to start sending the printer data "as is"...
And then close the connection...

Unfortunatelly I don't have any sample code for that, but if you know VB, you can try with MSwinsock just to understand what I'm talking about.

JpmSoft
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11441195
PAQed - no points refunded (of 500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question