473,626 Members | 3,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check "Is any device attached to COM port"?

1 New Member
Hi all,
I'm new to this community,so i think i shall introduce myself first, I'm a developer in VC++ 6.0 for past few years,

Now my mission to post this thread is

how can i find "Is any device is attached to the COM (Serial) port of my system using VC++/C++ ?

prblm:
Regardless of any device is connected to serial/COM port, the port can be opened using CFile, if no other programme has locked the port.
But i need to find Is any device is connected or not?

hope i haven't confused you.

Expecting help asap,as i'm stuck with this bottleneck for quite few hours,
Thanks in advance
Cheers,
Sujith
Aug 1 '06 #1
1 4351
Banfa
9,065 Recognized Expert Moderator Expert
I don't believe this is possible. The most basic type of device only implements ground, Tx and Rx so you have no electrical signal to tell you if a device is connected. You could look for data but not all devices send unsolicited data so you would need to know a way of getting any device to return data to you.

So detecting any device is impossible.

Detecting specific devices is possible though, for instance you could detect any modem using the Hayes command set by sending AT, all Hayes command set modems will reposnd to this with OK.
Aug 1 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3461
by: Alex Shi | last post by:
Hello, I got an error message when trying following script: <? //...... if (!$handle = fsockopen ("ssl://my.com", 443, $errno, $errstr, $timeout = 30)) { print "$errno: $errstr\n"; return -1; /* connection failed */
0
1450
by: John Roper | last post by:
Hi, I have a web deployment project that asks for the port number in the standard dialog (along with the virtual directory). I also install a web service and this does not have an associated dialog. How do I use the port number (filled in the first dialog) when installing the web service? I reckon I should change the propety for the port of the web service, perhaps in a custom action, but I don't know how to make this change. I already...
3
2163
by: Stinky Pete | last post by:
I've mananged to get Access Run-time working on a Win 98 PC. I was stoked at that achievement, however I'm now stuck in that the files are opening Read only. That is, I can view all the records via the two forms I need but not change anything. Why? The command line for the user to access the file is simply as follows (from advice via msdn.microsoft.com) "C:\MS Runtime\Office10\MSACCESS.EXE" "Q:\QA Records Database\Vaccine...
0
1637
by: ASP Developer | last post by:
For some reason when I direct my users to a word document via Response.ContentType = "application/word" the spell check is turned off. Does anyone know which smart tag needs to be mofied to have it on by default. It appears as though it might be <w:SpellingState>Clean</w:SpellingState>. However, I haven't found any web sites that discusses what alternative values of this tag might will accept. Any help would be greatly appreciated.
1
2480
by: Richard | last post by:
Hi, I'm running WebMatrix, v. 0.6.812, over WinXP/SP2 with .Net Framework 1.0 & 1.1. I'm following the examples in ASP.NET Web Matrix Project Guided Tour, specifically the 2nd example at http://www.asp.net/webmatrix/tour/section1/addbasiccontrols.aspx. When testing the 2nd example, I accepted the default port (8080) for the WebMatrix web server and got the message "Port already in use ...".
5
18472
by: Matthew Zhou | last post by:
I check the ISO 9899 standard, \r (carriage return) Movesthe active position to the initial position of the current line. What does it do? How to input? I tried to use Flex to check this pattern as below: %%
4
20548
by: robinp.la | last post by:
Can someone explain how I would read the data from the USB "port"? I don't know if it matters, but I am trying to read the data from a GPS plugged in to the USB port. Thank you, Robin
94
30269
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
1
3190
by: syed asghar abbas | last post by:
I am Student of the BS(Cs) and i am student of the Final Term and my Final Project on the Barcode Reader that "How to Connect the Barcode Reader Device Scanner With Sql Database in C# 2005 "
0
8269
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8203
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7203
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2630
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.