ComObj property set by reference
Original Reporter info from Mantis: serbod
-
Reporter name:
Original Reporter info from Mantis: serbod
- Reporter name:
Description:
Property assignment for ComObj variant in some case need special treatment (as in remarks from https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nf-oaidl-idispatch-invoke).
Included path fixing assignment of another COM object to property of COM object, as in example.
Steps to reproduce:
// At least two SAPI voices must be installed!
// Win7+ have 2 English voices by default
uses ComObj;
procedure TestVoice();
var
SpVoice, SpVoicesList: Variant;
begin
SpVoice := CreateOleObject('SAPI.SpVoice');
SpVoicesList := SpVoice.GetVoices();
// assign second speech voice as default voice, cause 'Member not found' error
SpVoice.Voice := SpVoicesList.Item(1);
SpVoice.Speak('Hello, world!');
end;
Mantis conversion info:
- Mantis ID: 38151
- Platform: Windows
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 47687 (#deaff6f7)