• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 489
  • Last Modified:

MScomm is missing events

Hello,

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 );
m_comm.SetRThreshold(1);  
m_comm.SetInputLen(0);  
m_comm.SetRTSEnable(TRUE);
0
Yigal123
Asked:
Yigal123
  • 3
  • 2
1 Solution
 
HooKooDooKuCommented:
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.
0
 
Yigal123Author Commented:
Is there more experts that experience the problem as I described and can advice there way of solving the problem ?
0
 
HooKooDooKuCommented:
If you want to follow up on the idea of using the API directly, here's an how-to I've found:
http://www.robbayer.com/files/serial-win.pdf

Here's just one example of some of the things you can find if you google "problems with MSComm control": http://comm32.com/mscomm32.html

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
0
 
Yigal123Author Commented:
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.
0
 
Yigal123Author Commented:
My solution is the one that solve the problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now