Compile errors with Borland C++ Builder, when using the Microsoft SAPI
Last reviewed: 10/30/1998
PRB Article ID: P109809
The information in this article applies to:
- SpeechKit 2.0 and 2.1
Symptoms
I currenty have an evaluation copy of SpeechKit 2.0 and am trying to use the function GetSAPITTS( ) to get the pointer to the ITTSCentral interface. When I try and include the speech header file from the Microsoft Speech SDK to definie the ITTSCentral interface I get compile errors. My build environment is Borland C++ Builder, using the Microsoft SAPI. How can I use this function if I cannot get the interface pointers defined?
Cause
The C++ Builder compiler does not like array definitions with 0 elements and it does not find a Microsoft typedef. The work around for the typdef was easy by declaring it LPVOID. The 0 array size declaration is not ANSI compatible and Borland will only allow it in an extern definition which cannot be done in the struct. So, we made a copy of the SAPI 3.0 speech.h header and set the array lengths to 1. The application compiles. Not the ideal solution, but a work around.
Status
The Chant components should obviate the need for you to access SAPI directly. In those cases where you need direct SAPI access, you can modify the header to be able to invoke the member functions you need.