[fpc-pascal] Microsoft SAPI on Freepascal

Michael Van Canneyt michael at freepascal.org
Mon Jun 26 21:39:12 CEST 2023



On Mon, 26 Jun 2023, Marco van de Voort via fpc-pascal wrote:

>
> On 26-6-2023 20:26, Michael Van Canneyt via fpc-pascal wrote:
>> 
>> I suspect COM is not properly initialized, and that Lazarus does this for 
>> you.
>> (it needs com for some components on windows)
>> 
>> So, try adding unit windows to the uses clause and add
>> 
>> CoInitialize(nil);
>> 
>> as the first statement of your program.
>> 
>> 
> (afaik 3.2.2's comobj does this automatically, in older version YMMV).

Well, I checked prior to sending my answer. If it does this, it's well hidden. 
There seems to be some hook for it, though.

Michael.


More information about the fpc-pascal mailing list