Solved

About LPT port capture

Posted on 1998-01-02
8
501 Views
Last Modified: 2008-02-01
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
Comment
Question by:amanuelx
[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
  • 6
  • 2
8 Comments
 
LVL 8

Accepted Solution

by:
mrmick earned 300 total points
ID: 1448789
You can enumerate through the connected printers with this:

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

0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448790
Whoops, that's

Dim P as Printer

For Each P in Printers
  Debug.Print P.DeviceName, P.DriverName, P.Port
Next
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448791
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:amanuelx
ID: 1448792
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
 
LVL 8

Expert Comment

by:mrmick
ID: 1448793
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
 

Author Comment

by:amanuelx
ID: 1448794
Ok, if i can assign my lpt1 to any printer of these, OK !
Regards
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448795
It's a deal, What's your email address?
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1448796
If you prefer, you can email it to me at mick@owen.wa.com
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

696 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