473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Isn't this possible in C#???

Hi All,

I have come across an application that runs in background and records the
communication over the Serial Port. How it works is, the sample application
needs to be started and mapped to a serial port say COM1. Then the
applicaiton starts waiting for the data over the configured port and logs
the same on arrival.

When I tried to write the similar application in CSharp I have hit the road
blocks. Basically, when I try to open a port that is already opened it
throws an exception that the port in use cannot be opened again.

Any ideas about what is the technique adopted by the sample application to
trap the serial port communication?

Thanks in advance,

Regards

Ramakant K.
Nov 22 '05 #1
3 1271
I'm just guessing here, but WMI is used to monitor a lot of things. Maybe
they're using this for monitoring COM ports as well?
--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
"Ramakant Kasar" <ra*******************@systime.co.in> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
Hi All,

I have come across an application that runs in background and records the
communication over the Serial Port. How it works is, the sample
application
needs to be started and mapped to a serial port say COM1. Then the
applicaiton starts waiting for the data over the configured port and logs
the same on arrival.

When I tried to write the similar application in CSharp I have hit the
road
blocks. Basically, when I try to open a port that is already opened it
throws an exception that the port in use cannot be opened again.

Any ideas about what is the technique adopted by the sample application to
trap the serial port communication?

Thanks in advance,

Regards

Ramakant K.

Nov 22 '05 #2
IMO you can't do that by opening the port again as this is an exclusive
resource.

It would be more something like using a driver allowing then to hook into
the port activity. Don't the sample application installs a driver ?

Patrice

--

"Ramakant Kasar" <ra*******************@systime.co.in> a écrit dans le
message de news:OF**************@TK2MSFTNGP14.phx.gbl...
Hi All,

I have come across an application that runs in background and records the
communication over the Serial Port. How it works is, the sample application needs to be started and mapped to a serial port say COM1. Then the
applicaiton starts waiting for the data over the configured port and logs
the same on arrival.

When I tried to write the similar application in CSharp I have hit the road blocks. Basically, when I try to open a port that is already opened it
throws an exception that the port in use cannot be opened again.

Any ideas about what is the technique adopted by the sample application to
trap the serial port communication?

Thanks in advance,

Regards

Ramakant K.

Nov 22 '05 #3
When I tried to write the similar application in CSharp I have hit the road
blocks. Basically, when I try to open a port that is already opened it
throws an exception that the port in use cannot be opened again.


This is a lower level problem... this needs to be done at the driver
level (C/C++ only). Also, there is no language that will let you open a
serial port twice.

Jamie
Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard...
9
by: Oscar Monteiro | last post by:
I´m trying to make an application with if ...something else if ... something else to dinamically change a src script, can't this be done ? and if so why not ? Thanks in advance , Oscar Monteiro...
14
by: ford_desperado | last post by:
Why isn't ALLOW REVERSE SCANS the default? Why do we have to - drop PK - create an index - recreate PK What are the advantages of indexes that do not allow reverse scans?
83
by: rahul8143 | last post by:
hello, what is difference between sizeof("abcd") and strlen("abcd")? why both functions gives different output when applied to same string "abcd". I tried following example for that. #include...
13
by: | last post by:
I'm curious if anyone knows why the C# and VB.NET compilers don't automatically call Dispose() on objects that support IDisposable when they go out of scope. I asked a co-worker and his response...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
8
by: Tomás | last post by:
Given the following: static_cast<T>( expr ) This will evaluate to an l-value if T is a reference type -- otherwise it will evaluate to an r-value. The same goes for reinterpret_cast. ...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
11
by: xicloid | last post by:
I'm trying to write a program that saves numbers without any duplications. I was thinking I could start by storing the first number in an array with size one, and if the next number is not in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.