[HELP] setting buffer lenght in MSCOMM
Hi,I have a program to read data using Microsoft Communication Control(MSCOMM). I want to set the buffer input length of 1 byte. but it can't run.
this is my program :
Code:
m_comm.SetCommPort(12);
m_comm.SetSettings("9600,N,8,1");
m_comm.SetInputLen(1); // read 1 byte data
m_comm.SetRTSEnable(FALSE);
m_comm.SetRThreshold(0);
m_comm.SetInBufferSize(1); // setting input buffer lenght
m_comm.SetPortOpen(true);
Do you have a solution?
Re: [HELP] setting buffer lenght in MSCOMM
Define "can't run".
Viggy
Re: [HELP] setting buffer lenght in MSCOMM
Quote:
Originally Posted by
azhari24
Hi,I have a program to read data using Microsoft Communication Control(MSCOMM). I want to set the buffer input length of 1 byte. but it can't run...
Do you have a solution?
Yes, I do.
Just get rid of MSCOMM. Use Windows APIs (or better, some free MFC classes like in http://www.flounder.com/serial.htm) instead.
Re: [HELP] setting buffer lenght in MSCOMM
In addition to Victors post, here's another class you can use for comm communication.
Re: [HELP] setting buffer lenght in MSCOMM
And here is another one, CSerialPort from PJ Naughter: http://www.naughter.com/serialport.html
Mike
Re: [HELP] setting buffer lenght in MSCOMM
Quote:
Originally Posted by
MrViggy
Define "can't run".
Viggy
okey, I will try...
Re: [HELP] setting buffer lenght in MSCOMM
Quote:
Originally Posted by
VictorN
okey. thank your answer...
Re: [HELP] setting buffer lenght in MSCOMM
Quote:
Originally Posted by
MikeAThon
okey, thanks, do you sample porgram?
Re: [HELP] setting buffer lenght in MSCOMM
Quote:
Originally Posted by
azhari24
okey, thanks, do you sample porgram?
At the site I linked to (i.e., at http://www.naughter.com/serialport.html ). Did you even bother to look at it?
Quote:
Originally Posted by PJ Naughter's site
The enclosed zip file contains the CSerialPort source code and a simple test program which exercises all class API's.
Mike