MScomm is missing events

Posted on 2012-09-03
Last Modified: 2012-09-10

I have C++ Application using MScomm  control  with 300 baud-rate External Modem connected to external device.
Our device send message every 20 seconds, when PC receives the message it replay with Acknowledge .

Problem description,
MScomm is not firing event for every message send by our device, sometimes it take 2 to 4 messages  until MSComm fire event,
When getting the input buffer I see all the messages in MSComm buffer (few messages).

The qeustion is why MScomm is not fire event for each message ? instead it keep few messages and then fire event to all of them.

My App. settings

m_comm.SetInBufferCount( 0 );
Question by:Yigal123
    LVL 16

    Expert Comment

    I don't know for sure about the modern C++ world, but I learned the hard way back in VB6 "don't use the MSComm object".  At least the VB version, I found were some of the features didn't work as documented (like a "ready" flag that was always "TRUE" no matter what") and that the control would drop its connection to an open port from time to time, and would not reestablish without rebooting the OS.

    While there are not many people I've personally known that needed Comm interfaces in a professional setting, but those I have known have all avoided MScomm control and just learned to access the ports directly with the API.

    Author Comment

    Is there more experts that experience the problem as I described and can advice there way of solving the problem ?
    LVL 16

    Expert Comment

    If you want to follow up on the idea of using the API directly, here's an how-to I've found:

    Here's just one example of some of the things you can find if you google "problems with MSComm control":

    I wish I could be specifically more help, but I don't have extended experience attempting to utilize the com ports... just one major program I tried to write in VB years ago that was a dismial failure at staying active over long periods of time trying to use MSComm

    Accepted Solution

    After a lots of testing I found that setting the port "Reciever Buffer" to "1" from device manager and then reset the PC (otherwise it will not work), solve the problem.

    Thanks a lot.

    Author Closing Comment

    My solution is the one that solve the problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Promote certifications in your email signature

    Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

    When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
    Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
    Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now