Solved

Windows API to Create a New Printer port.

Posted on 2004-04-05
8
447 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
8 Comments
 
LVL 5

Expert Comment

by:rajaamirapu
Comment Utility
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
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
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Rowdyone52
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed - no points refunded (of 500)

modulo
Community Support Moderator
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now