Solved

Availability of the printer port?

Posted on 2000-02-15
6
240 Views
Last Modified: 2013-11-15
Hello guys,

In my GUI, i have list of ports which i need to select one to configure my printer! but i want to find if the selected port is already been used by some other printer or device? from visual c++ code how do i do that? any idea?
0
Comment
Question by:vchellam
[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
  • 4
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 2523601
usually in windows you would have the OS deal with determining which printer port to use and how to configure it.   But if you want to do it yourself, simply try to open port as a file using CreateFile().  I the port is already open, the CreateFile() will fail.

Let me know if you have any questions.
0
 

Author Comment

by:vchellam
ID: 2523818
Adjusted points to 150
0
 

Author Comment

by:vchellam
ID: 2523819
what i want to do is first to find out if its been used by any printer if so i have to put  message the its been used by the corresponding printer, if not used by printer, its used by some other device, i was put the message that the device is using! so i need the printer name using that port
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!

 
LVL 22

Expert Comment

by:nietod
ID: 2524157
I think the EnumPorts() function should do what you want.  It will enumerate all the ports that are beign used by the printer server.
0
 

Author Comment

by:vchellam
ID: 2528488
Adjusted points to 200
0
 

Author Comment

by:vchellam
ID: 2528489
Thanks guys, i used enumprinters which tells the ports used by the current printers and i also used createfile functions

thanks guys for helping me out!
Venky
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

A list of useful business intelligence software.
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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