Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMicrosecond timer Pin
azhari2411-Sep-11 15:24
azhari2411-Sep-11 15:24 
AnswerRe: Microsecond timer Pin
David Crow11-Sep-11 17:24
David Crow11-Sep-11 17:24 
GeneralRe: Microsecond timer Pin
azhari2412-Sep-11 2:37
azhari2412-Sep-11 2:37 
AnswerRe: Microsecond timer Pin
CPallini11-Sep-11 22:17
mveCPallini11-Sep-11 22:17 
GeneralRe: Microsecond timer Pin
azhari2412-Sep-11 2:38
azhari2412-Sep-11 2:38 
AnswerRe: Microsecond timer Pin
Erudite_Eric12-Sep-11 1:25
Erudite_Eric12-Sep-11 1:25 
GeneralRe: Microsecond timer Pin
azhari2412-Sep-11 2:39
azhari2412-Sep-11 2:39 
AnswerRe: Microsecond timer Pin
azhari2412-Sep-11 3:08
azhari2412-Sep-11 3:08 
microcontroller send data every 2 ms, my problem when the microcontroller gets the input, the program can not display the data directly, but must read the entire remainder of the data in the buffer.

this is setting port, and recevied data. I use Microsoft Communication Control
    TRY
{
m_comm.SetCommPort(12); // use port 12
m_comm.SetSettings("9600,N,8,1"); // setting port
m_comm.SetInputLen(1); // read 1 character
m_comm.SetRTSEnable(FALSE);
m_comm.SetRThreshold(0);
m_comm.SetPortOpen(true); // open port
UpdateData(FALSE);
    MessageBox("Port opened successfully");
}
CATCH(CException, e)
{
    MessageBox("Error opening port");
}
END_CATCH

so I use the clear buffer to clear the buffer. but rather the execution time becomes slow and missing data
m_comm.SetInBufferCount(0); // clear buffer
        }

can you offer some advice?
GeneralRe: Microsecond timer Pin
Erudite_Eric12-Sep-11 4:14
Erudite_Eric12-Sep-11 4:14 
AnswerRe: Microsecond timer Pin
jschell12-Sep-11 8:40
jschell12-Sep-11 8:40 
GeneralRe: Microsecond timer Pin
enhzflep12-Sep-11 8:48
enhzflep12-Sep-11 8:48 
GeneralRe: Microsecond timer [modified] Pin
Erudite_Eric12-Sep-11 20:42
Erudite_Eric12-Sep-11 20:42 
GeneralRe: Microsecond timer Pin
pandit8413-Sep-11 3:59
pandit8413-Sep-11 3:59 
GeneralRe: Microsecond timer Pin
azhari2413-Sep-11 9:46
azhari2413-Sep-11 9:46 
GeneralRe: Microsecond timer Pin
jschell13-Sep-11 11:42
jschell13-Sep-11 11:42 
GeneralRe: Microsecond timer [modified] Pin
azhari2413-Sep-11 18:57
azhari2413-Sep-11 18:57 
GeneralRe: Microsecond timer Pin
Erudite_Eric13-Sep-11 22:46
Erudite_Eric13-Sep-11 22:46 
GeneralRe: Microsecond timer Pin
azhari2413-Sep-11 18:58
azhari2413-Sep-11 18:58 
GeneralRe: Microsecond timer Pin
azhari2413-Sep-11 18:54
azhari2413-Sep-11 18:54 
QuestionGetting the handle of a PictureBox in MFC Pin
Tom Moore11-Sep-11 2:16
Tom Moore11-Sep-11 2:16 
AnswerRe: Getting the handle of a PictureBox in MFC Pin
Randor 11-Sep-11 3:34
professional Randor 11-Sep-11 3:34 
QuestionHow to use the hook function of Windows FileOpen dialog Pin
clever10110-Sep-11 1:29
clever10110-Sep-11 1:29 
AnswerRe: How to use the hook function of Windows FileOpen dialog Pin
Philippe Mori10-Sep-11 16:25
Philippe Mori10-Sep-11 16:25 
QuestionLive video processing Pin
Smith#9-Sep-11 21:32
Smith#9-Sep-11 21:32 
AnswerRe: Live video processing Pin
Richard MacCutchan9-Sep-11 23:02
mveRichard MacCutchan9-Sep-11 23:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.