69,374
社区成员
发帖
与我相关
我的任务
分享
#include <sapi.h>
#include <atlbase.h>
#include <sphelper.h>
//typedef LONG HRESULT;
inline HRESULT BlockForResult(ISpRecoContext * pRecoCtxt, ISpRecoResult ** ppResult)
{
HRESULT hr = S_OK;
CSpEvent event;
/*#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
Provides a generic test for success on any status value. Non-negative numbers indicate success.*/
while (SUCCEEDED(hr) &&
SUCCEEDED(hr = event.GetFrom(pRecoCtxt)) &&
hr == S_FALSE)
{
hr = pRecoCtxt->WaitForNotifyEvent(INFINITE);
}
*ppResult = event.RecoResult();
if (*ppResult)
{
(*ppResult)->AddRef();
}
return hr;
}