Solved

Availability of the printer port?

Posted on 2000-02-15
6
238 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
  • 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sorting efficency of sorting algorithm 30 121
Header of docx file 17 115
PCAnywhere 2 135
Software to compare two files and flag if they are different 2 59
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

861 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