Re:Re: Startup help with SAPI: recreation of sapi.lib
Marc:
Been out all day and just saw your notes.
I don't recall having any problem with the sapi files.
I'm running XP MediaCenter which is XP Pro with Media Center added.
I also installed the same program on a PC with Vista Home Basic and it
worked fine immediately on that computer.
What operating system are you using?
Then again, I'm using BDS 2006. What are you using?
Maybe we can get someone from the B Team to clear this up.
John
"Marc" <
XXXX@XXXXX.COM >wrote in message
Quote
I had to recreate the sapi.lib file using a hint I found under
groups.google.com/group/microsoft.public.sapi5.beta/browse_thread/thread/266dbd95a122f538/67583689d599d4fa
>>>>>>>>>>
You were right, I only had to use MIDL with sapi.idl file, and
its /c_ext option. This running generated two files: sapi_i.c and
sapi_p.c. I've add the first one to my project and it works!!
>>>>>>>>>>
Now it works for me too :-)
Rds
Marc
"Marc" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
news: XXXX@XXXXX.COM ...
>I also tried to use coff2omf to convert the sapi.lib library, but the
>resulting library is only 1Kb (the original sapi.lib has 39kB) and it
>gives me the same error message....
>What am I doing wrong here ?
>
>Rds
>Marc
>
>"Marc" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
>news:473f0239$ XXXX@XXXXX.COM ...
>>John
>>
>>I tried this but hit a wall.
>>I used implib to create a BCB compatible library, but now I get the
>>errors
>>
>>[Linker Error] Unresolved external '_IID_ISpVoice' referenced from
>>T:\UNIT2.OBJ
>>[Linker Error] Unresolved external '_CLSID_SpVoice' referenced from
>>T:\UNIT2.OBJ
>>
>>I found some references for this on Google, but no solution :-(
>>
>>Rds
>>Marc
>>
>>
>>
>>"JohnC" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
>>news:473ee927$ XXXX@XXXXX.COM ...
>>>The following will "speak" anything - numbers as well as words.
>>>John
>>>//---------------------------------------------------------------------------
>>>
>>>#ifndef JMCSpeechH
>>>#define JMCSpeechH
>>>
>>>#include <sapi.h>//For ISp definitions - part of SDK
>>>
>>>//---------------------------------------------------------------------------
>>>
>>>//Speech Utilities:
>>>//This object instantiates the COM Object SpVoice and gives us an easy
>>>//function call in order to speak a string.
>>>
>>>class TJMCSpeech
>>>{
>>>public:
>>>TJMCSpeech(); //Constructor
>>>~TJMCSpeech(); //Destructor
>>>void Speak(String Words); //Speak the input words in the string.
>>>private:
>>>HRESULT hr;
>>>ISpVoice* pVoice;
>>>};
>>>
>>>
>>>#endif
>>>-------------------
>>>//---------------------------------------------------------------------------
>>>#include <vcl.h>
>>>#pragma hdrstop
>>>
>>>#include "JMCSpeech.h"
>>>//#include "SUTIL.h"
>>>//---------------------------------------------------------------------------
>>>
>>>#pragma package(smart_init)
>>>
>>>//Constructor
>>>TJMCSpeech::TJMCSpeech()
>>>{
>>>hr = S_OK;
>>>pVoice = NULL;
>>>::CoInitialize(NULL);
>>>
>>>//Create a SAPI voice:
>>>hr = CoCreateInstance( CLSID_SpVoice,NULL,CLSCTX_ALL,IID_ISpVoice,
>>>(void**)&pVoice);
>>>}
>>>//Destructor
>>>TJMCSpeech::~TJMCSpeech()
>>>{
>>>if(SUCCEEDED(hr))
>>>pVoice->Release();
>>>
>>>::CoUninitialize();
>>>}
>>>//---------------------------------------------------------------------------
>>>void TJMCSpeech::Speak(String Words)
>>>{
>>>if(SUCCEEDED(hr))
>>>pVoice->Speak(WideString(Words),SPF_DEFAULT,NULL);
>>>}
>>>//Note: I originally had:
>>>// pVoice->Speak(TJMCSUtil::StrToBSTR(Words),SPF_DEFAULT,NULL);
>>>//It was pointed out by Remy Lebeau (TeamB) < XXXX@XXXXX.COM >
>>>//that this was a memory leak and that I should use the following:
>>>// pVoice->Speak(WideString(Words),SPF_DEFAULT,NULL);
>>>//---------------------------------------------------------------------------
>>>
>>>
>>>"Marc" < XXXX@XXXXX.COM >wrote in message
>>>news:473ebe39$ XXXX@XXXXX.COM ...
>>>>Hi all
>>>>
>>>>I try to implement a simple SAPI application that reads back a phone
>>>>number. I downloaded the SDK 5.1 from Microsoft and had a look at the
>>>>samples... and did not quite got into it. Does someone has a simple
>>>>sample in BCB that just shows how to speak a number?
>>>>
>>>>Rds
>>>>Marc
>>>>
>>>
>>>
>>
>>
>
>