Article View: borland.public.cppbuilder.nativeapi
Article #1112Re: SAPI Failure under Vista - Help!
From: JohnC
Date: Tue, 23 Oct 2007 11:43
Date: Tue, 23 Oct 2007 11:43
60 lines
2878 bytes
2878 bytes
Guess I won't try it after all.
Here is what I am doing in my production version:
//---------------------------------------------------------------------------
// WIDE STRING SUPPORT
//---------------------------------------------------------------------------
BSTR TJMCSUtil::StrToBSTR(String InStr)
{
BSTR OutStr;
WideString* pWStr;
WideChar* pWChars;
pWStr = NULL;
pWChars = NULL;
pWStr = new WideString(InStr);
pWChars = *pWStr;
OutStr = ::SysAllocString(pWChars);
delete pWStr;
return(OutStr);
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void TJMCSpeech::Speak(String Words)
{
if(SUCCEEDED(hr))
pVoice->Speak(TJMCSUtil::StrToBSTR(Words),SPF_DEFAULT,NULL);
}
//---------------------------------------------------------------------------
This is what led to the floating pont exception under Vista in the first
place.
The L format with the fixed string led to the same problem.
John
"JohnC" <jcibulskis@sbcglobal.net> wrote in message
news:471ddb48@newsgroups.borland.com...
> Remy:
> I respect your statements since you are a TeamB member.
> However, in all the Microsoft documentation examples, they use the form
> that I used for this example.
> See, for example:
> http://msdn2.microsoft.com/en-us/library/ms720163(d=printer).aspx
>
> In addition, originally I was creating a BSTR, but in order to make the
> example simpler for the newsgroup, I went with the example from Microsoft.
>
> I will try the method
>
>> void TJMCSpeech::Speak(String Words)
>> {
>> if(SUCCEEDED(hr))
>> pVoice->Speak(WideString(Words), SPF_DEFAULT, NULL);
>> }
>>
>
> which you recommended and see what happens.
> Thanks,
> John
>
Technical Details
Message-ID:
<471dde5b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<471a1686@newsgroups.borland.com> <471cd115$1@newsgroups.borland.com> <471ddb48@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6c3b668ca80ad7d9 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "JohnC" <jcibulskis@sbcglobal.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <471a1686@newsgroups.borland.com> <471cd115$1@newsgroups.borland.com> <471ddb48@newsgroups.borland.com> Subject: Re: SAPI Failure under Vista - Help! Date: Tue, 23 Oct 2007 06:43:20 -0500 Lines: 62 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 76.223.245.175 Message-ID: <471dde5b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1193139803 76.223.245.175 (23 Oct 2007 04:43:23 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail