Ports
May 19, 2013, 02:05:26 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
Serial Ports
>
Chek if com port is in use by another application
Pages: [
1
]
« previous
next »
Print
Author
Topic: Chek if com port is in use by another application (Read 2548 times)
Tassos
Member
Posts: 2
Chek if com port is in use by another application
«
on:
September 29, 2011, 02:09:12 am »
Hello!
It's my first time in the forum and i need your help!
I want to check, in vb 2008 code, if a com port is in use by another application so not to mess with it.
is the a way to do it?
Thank you very much,
Tassos
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1625
Re: Chek if com port is in use by another application
«
Reply #1 on:
September 29, 2011, 09:39:23 am »
See this discussion:
http://stackoverflow.com/questions/195483/c-check-if-a-com-serial-port-is-already-open
Jan
Logged
Tassos
Member
Posts: 2
Re: Chek if com port is in use by another application
«
Reply #2 on:
September 29, 2011, 10:08:06 am »
Thank you very much!
Logged
Duss
Member
Posts: 12
Re: Chek if com port is in use by another application
«
Reply #3 on:
December 28, 2011, 11:00:26 pm »
The solution to that problem in C# works very well. However, when I try the same approach in C++ (Windows Forms Application) it simply fails to catch the situation and fais into an error (exception) that actually is not caught by the program, even if I use the generic "Exception" type.
It is very annoying because my C++ application sometimes shows an existing COMport but it is already being used by another application and the program cannot determine if it really is being used or not.
Does anyone have an explanation?
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1625
Re: Chek if com port is in use by another application
«
Reply #4 on:
December 29, 2011, 11:06:18 am »
Trying to open the port (with CreateFile) should tell you if it's in use.
Jan
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...