• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

About LPT port capture

Hello
I need see the printers in an PC and capture a port for connect to this printers. Under Win95 and Windows NT.
In other words:
How to capture an LPT port and how to see what printers have shared another computer?
Thanks and regards
0
amanuelx
Asked:
amanuelx
  • 6
  • 2
1 Solution
 
mrmickCommented:
You can enumerate through the connected printers with this:

Dim P as printer
For each P in printers
   debug.print p.name
Next

0
 
mrmickCommented:
Whoops, that's

Dim P as Printer

For Each P in Printers
  Debug.Print P.DeviceName, P.DriverName, P.Port
Next
0
 
mrmickCommented:
What do you mean by "capture an LPT Port"?

To enumerate the printers available on the network that are shared but NOT connected.  You can use the API function:

WNetEnumResource


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
amanuelxAuthor Commented:
Well, i can see the printers availables if i before select it.
I need too see the other pc's and see if they have any printer shared.
i need then assign my lpt1 port to any of these printers, and then (once used) deassign this lpt1 port.
Tx
0
 
mrmickCommented:
This is a little more complicated, If you'd like, I'll write you an example of enumerating all available shared network printers on the network, and an example of how to connect to and disconnect from a network resource.

If this is acceptable, provide your email address so I can send you the sample project.  Also, you must agree to give me credit for the answer to this question once I've provided the examples.
0
 
amanuelxAuthor Commented:
Ok, if i can assign my lpt1 to any printer of these, OK !
Regards
0
 
mrmickCommented:
It's a deal, What's your email address?
0
 
mrmickCommented:
If you prefer, you can email it to me at mick@owen.wa.com
0

Featured Post

Industry Leaders: 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!

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now