Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-06

Exception when trying to set a COM object property through OleVariant

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lubos Pintes

Hello,
I am using FPC 3.1.1.
I am playing with SAPI5. It almost works, but I am unable to set a Voice of SPVoice object through OleVariant.
The following program works fine in Delphi 6, but an exception on line 12 is raised when compiled by FPC:

program sapi;
uses
   ActiveX, ComObj;
var
   SPVoice: OleVariant;
begin
   CoInitializeEx(nil, 0);
   SPVoice := CreateOleObject('SAPI.SPVoice');
   SPVoice.Voice := SPVoice.GetVoices.Item(5);
   SPVoice.Speak('Hello from SAPI5.', 0);
end.

Reply by email

Jonas Maebe
to Lubos Pintes
Lubos Pintes wrote 5 lines
I am using FPC 3.1.1. I am playing with SAPI5. It almost works, but I am unable to set a Voice of SPVoice object through OleVariant. The following program works fine in Delphi 6, but an exception on line 12 is raised when compiled by FPC:

Please mention that you're not subscribed when posting to a mailing list, so subscribers know they have to CC you when replying.

Jonas

Reply by email