Hmm, ok, apparently something changed in the way FPC handles objects
between 3.31 and 3.20 (the version I'm using).
Thought I had 3.22, but <shrug>.
I guess it could be a sapi version difference too, but I don't know how
to check that.
On 6/26/2023 11:15 PM, James Richters wrote:
When I run the code below I get:
An unhandled exception occurred at $004143C0:
■ Free Pascal IDE Version 1.0.12 [2022/02/07]
■ Compiler Version 3.3.1-10077-gc8403ad49e
■ GDB Version GNU gdb (GDB) 7.2
Running "i:\programming\sapi.exe "
EOleError: Variant does not reference an automation object
$004143C0
$004194DD
$0040B991
$0040193B SPEAK, line 13 of i:/programmingl/sapi.pas
$00401962 main, line 17 of i:/programming/sapi.pas
program voice;
uses
comobj;
procedure speak(s : string);
var
v : olevariant;
begin
v:=CreateOleObject('SAPI.SpVoice');
v.Speak(s);
end;
begin
speak('Hello.');
end.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal