VOID main()
{
LPTTS_HANDLE_TAG phTTS;
TextToSpeechStartupEx(&phTTS, WAVE_MAPPER,REPORT_OPEN_ERROR, Callback, 0);
}
VOID Callback(LONG lParam1, LONG lParam2, DWORD dwCallbackParameter, UINT uiMsg)
{
if (uiMsg == TTS_MSG_STATUS)
{
// lParam1 contains error code
// lParam2 contains value of MMRESULT
}
else if (uiMsg == TTS_MSG_INDEX_MARK)
{
// lParam2 contains index mark
}
else if (uiMsg == TTS_MSG_BUFFER)
{
// lParam2 contains Pointer to buffer
}
}