Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with Timer application in VC6

Status
Not open for further replies.

Longmcx

Junior Member level 1
Joined
Sep 28, 2004
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
147
i have core for my application
////
void CExbuttonDlg::OnTimer(UINT nIDEvent)
{
char receive ;
DWORD nByte;
ReadFile(hCom, &receive, 1, &nByte, NULL);

if (receive == 'b')
check = true;
}
but if i start my application, it hang up.
i don't know why? please help me
thanks for your attention.
 

timer vc6

hi,
check what have you set the SetTimer to, i,e the time you want the OnTimer to be triggered, the hang you are seeing is due to the reason that when the OnTimer executes the call to ReadFile blocks till the data is read, so the whole app is blocked till anything is read from ReadFile and ReadFile returns, hence i suggest you to use multiple threads in your app, i,e create a new thread and its sole purpose is to read via ReadFile.
hope that clears your issue.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top