[fpc-pascal] IDispatch with Variant is not working on Linux. Why?

Anthony Walter sysrpl at gmail.com
Wed Nov 1 16:14:55 CET 2023


Thank you Micahel,

I was doing some research last night and found that there are two specific
stubs in the System unit that are implemented by the ComObj unit.
Specifically, a stub for safe call exception handling and dispatch invoke.
I was working with my example and added my own OS agnostic implementations
of those two functions. This eliminated the access violations.

I am not finished testing my solution, but in cases where late binding is
desired, it ought to be possible to have it work on all platforms so long
as the late binding is not attempting to cross process boundaries, which is
common on Windows when using out of process servers such as Word or Excel.
Perhaps my use case for late binding to a self contained scripting library
might be useful for other people Free Pascal who do not run Windows. I am
sure there are other possible use cases as well. In that light, it might be
useful to integrate my eventual implementation into some unit included with
FPC.

For anyone interested in this topic, late binding on platforms other than
Windows, or the use of JavaScript, I have written on this subject in the
past. The article I wrote below hosted on my blog can give you more insight
into an aspect of the topic:

https://www.codebot.org/delphi/?doc=9573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20231101/347b6020/attachment.htm>


More information about the fpc-pascal mailing list