Link to home
Start Free TrialLog in
Avatar of Yigal123
Yigal123

asked on

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);
Avatar of HooKooDooKu
HooKooDooKu

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.
Avatar of Yigal123

ASKER

Is there more experts that experience the problem as I described and can advice there way of solving the problem ?
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
ASKER CERTIFIED SOLUTION
Avatar of Yigal123
Yigal123

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My solution is the one that solve the problem.