while(1) { ........ ReadFile(_CommHndl,RxBuf,500,&RxSz,NULL); if (RxSz) { DoSomething (...RxBuf,RxSz...); } }