Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » problem with <sapi.h>, text to speech library
problem with <sapi.h>, text to speech library [message #50664] |
Sat, 01 December 2018 11:33  |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
I am able to compile and run the following not UPP code within Theide after linking Ole32.lib and SAPI.lib
#include <iostream>
#include <string>
#include <ctime>
#include <sapi.h>
//type something in to have it spoken!
//enter quit to exit
int main()
{
ISpVoice * pVoice = NULL;
if (FAILED(::CoInitialize(NULL)))
return EXIT_FAILURE;
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
if(SUCCEEDED(hr))
{
std::wstring in = L"";
while( std::getline(std::wcin, in) && in != L"quit") {
hr = pVoice->Speak((LPCWSTR)in.c_str(), NULL, NULL);
}
pVoice->Release();
pVoice = NULL;
}
::CoUninitialize();
return EXIT_SUCCESS;
}
However I cannot compile the same code within my U++ program.
c:\program files (x86)\windows kits\10\include\10.0.17134.0\um\ocidl.h (2918): error C2061: errore di sintassi: identificatore 'CY'
The error appear at the include of
#include <sapi.h>
In fact I can comment the relevant code and let stay alone the include to let appear the same problem.
After googling it seems that the problem is that the compiler is confused by several previous includes. Here is my U++ includes that could collide with <sapi.h>
#include <CtrlCore/CtrlCore.h>
#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>
#include <Report/Report.h>
#include <RichEdit/RichEdit.h>
//#include <Web/Web.h>
#include <PdfDraw/PdfDraw.h>
#include <plugin/ftp/ftp.h>
#include <plugin/pcre/Pcre.h>
#include <plugin/jpg/jpg.h>
#include <RepGen/RepGen.h>
#include <MySql/MySql.h>
#define IMAGECLASS Vega8Img
#define IMAGEFILE <Vega8/Vega.iml>
#include <Draw/iml_header.h>
#define SCHEMADIALECT <MySql/MySqlSchema.h>
#define MODEL <Vega8/db.sch>
#include <Sql/sch_header.h>
using namespace Upp;
Does anybody tried the <sapi.h> inside his app? Any suggestion?
Thanks,
Luigi
|
|
|
Goto Forum:
Current Time: Mon Apr 28 10:09:48 CEST 2025
Total time taken to generate the page: 0.00590 seconds
|