How to check COM1 port already open or not

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Aug 2009
Posts: 22
Reputation: jp071 has a little shameless behaviour in the past 
Solved Threads: 0
jp071 jp071 is offline Offline
Newbie Poster

How to check COM1 port already open or not

 
0
  #1
Aug 13th, 2009
Hello,
Anybody can give me idea, How can i check COM port? I want to check, is it already open or not? if it is already open, just avoid to open the port.

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,577
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1486
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: How to check COM1 port already open or not

 
-7
  #2
Aug 13th, 2009
Just try to open it -- if open files then its probably already opened (assuming COM1 exists and there are no hardware problems)
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 22
Reputation: jp071 has a little shameless behaviour in the past 
Solved Threads: 0
jp071 jp071 is offline Offline
Newbie Poster

Re: How to check COM1 port already open or not

 
0
  #3
Aug 21st, 2009
My problem is not exactly that. I have another software that run semultaniously. The software also can open the COM1 port. If it opened, my program do not need to open COM1 port. Then Just i want to read data from the port.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 360
Reputation: jencas is just really nice jencas is just really nice jencas is just really nice jencas is just really nice jencas is just really nice 
Solved Threads: 69
jencas jencas is offline Offline
Posting Whiz

Re: How to check COM1 port already open or not

 
0
  #4
Aug 21st, 2009
If the COM1 port is in use by an other process, this resource is locked by the OS and subsequent tries to open the COM1 port will fail.
If you are forced to reinvent the wheel at least try to invent a better one!

Please use code tags - Please mark solved threads as solved
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 22
Reputation: jp071 has a little shameless behaviour in the past 
Solved Threads: 0
jp071 jp071 is offline Offline
Newbie Poster

Re: How to check COM1 port already open or not

 
0
  #5
Aug 21st, 2009
Thanks for your post. I could able to solve the problem.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 360
Reputation: jencas is just really nice jencas is just really nice jencas is just really nice jencas is just really nice jencas is just really nice 
Solved Threads: 69
jencas jencas is offline Offline
Posting Whiz

Re: How to check COM1 port already open or not

 
0
  #6
Aug 21st, 2009
Then mark this thread as solved, please
Last edited by jencas; Aug 21st, 2009 at 9:49 am.
If you are forced to reinvent the wheel at least try to invent a better one!

Please use code tags - Please mark solved threads as solved
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: How to check COM1 port already open or not

 
0
  #7
Aug 21st, 2009
Better yet, tell US what you found out, how you solved it and then mark it closed.
Give something back.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC