// use Win32 events for command-line style application
hr=cpRecoContext->SetNotifyWin32Event();
CHECK_HR;
// activate dictation, and begin recognition
hr=cpRecoGrammar->SetDictationState(SPRS_ACTIVE);
CHECK_HR;
// while events occur, continue processing
// timeout should be greater than the audio stream length, or a reasonable amount of time expected to pass before no more recognitions are expected in an audio stream