My second example was cribbed from the ISpVoice::SetOutput documentation.
Unfortunately, it won't compile past
#include <sphelper.h>
because I get the errors
c:\program files\microsoft speech sdk 5.1\include\sphelper.h(769) : error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
c:\program files\microsoft speech sdk 5.1\include\sphelper.h(1419) : error
C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
c:\program files\microsoft speech sdk 5.1\include\sphelper.h(2373) : error
C2065: 'psz' : undeclared identifier
c:\program files\microsoft speech sdk 5.1\include\sphelper.h(2559) : error
C2440: 'initializing' : cannot convert from 'CSpDynamicString' to 'SPPHONEID
*'
No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
c:\program files\microsoft speech sdk 5.1\include\sphelper.h(2633) : error
C2664: 'wcslen' : cannot convert parameter 1 from 'SPPHONEID *' to 'const
wchar_t *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
The first, three, at least, all seem quite legitimate to me when I look at
sphelper.h itself (I can't say much about the others; maybe there's a typedef
dropped somewhere).
These are all compiler errors on my completely vanilla, newly-installed
samples, and they're in the headers of the SAPI SDK itself. I wonder if
there's a patch or something I'm missing?
Thanks for any help,
dave
Ln 769
const ulLenVendorPreferred = wcslen(pszVendorPreferred);
const unsigned long ulLenVendorPreferred = wcslen(pszVendorPreferred);
Ln 1418
static CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX **
ppCoMemWFEX)
static HRESULT CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX **
ppCoMemWFEX)
Ln 2372
for (const WCHAR * psz = (const WCHAR *)lParam; *psz; psz++) {}
const WCHAR * psz; for (psz = (const WCHAR *)lParam; *psz; psz++) {}
Ln 2559
SPPHONEID* pphoneId = dsPhoneId;
SPPHONEID* pphoneId = (SPPHONEID*)((WCHAR *)dsPhoneId);
Ln 2633
pphoneId += wcslen(pphoneId) + 1;
pphoneId += wcslen((const wchar_t *)pphoneId) + 1;
Still there is warning, but it can pass the compile and works well on my
vs2005.
Besides, there are still a lot of grammer errors in the sample's code.
Though it's really little errors, it sucks me.
I just can't believe these codes were written by MS's facility.