?
Solved

Check DCD(Data Carrier Detect) using MFC

Posted on 1997-09-19
1
Medium Priority
?
443 Views
Last Modified: 2013-11-19
I want to check the DCD in a program which used for RS232
communication and written by MFC.
I can set DTR and RTS control via the data the structure
DCB. But there is no DCD checking parameter in DCB
structure. Can anyone tell me how to check DCD status?
0
Comment
Question by:hbh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
stefanr earned 100 total points
ID: 1306594
You could user the WIN32 API function GetCommModemStatus, like this:

BOOL CComPort::GetCD() const
{
   DWORD dwModemStat = 0;

   if (!::GetCommModemStatus(m_hFile, &dwModemStat))
      TRACE("Warning: Failed to retrieve Modem Status. Error Code %lu\n", ::GetLastError());

   return (dwModemStat & MS_RLSD_ON) == MS_RLSD_ON;
}

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

800 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