On Tuesday, 4 November 2025 at 10:27:13 UTC, Dennis wrote:
On Monday, 3 November 2025 at 16:51:25 UTC, Vinod K Chandran
wrote:
I was worrying that there is no com support except the basic
building blocks like IUnknown and siblings. I know there is a
com library in Adam's arsd. But I couldn't successfully use
that. When I first tried Adam's library, I dreamed to write a
com client in D one day. When time permitted, I slowly
collected information about com and gradually made a
confidence to start with early binding. I want to make my
library high performance, so I choose early binding path.
I have succesfully made a D program connect to Excel using
arsd.com last year. My strategy was to ask ChatGPT to give
examples using Python win32com and then translate those calls
to D by sometimes adding extra parenthesis (because of
limitations of @property / opDispatch). The resulting code
looks something like this:
```D
const choice = cell.Value().getD!string.ifThrown!Exception("");
// ...
auto c1 = sheet.Cells()(varsRow + i, varsValueColumn);
c1.Formula() = "=" ~ cs;
c1.Interior().Color() = color;
```
It's using the dynamic IDispatch interface instead of static
bindings, which might be slower, but most calls take
milliseconds to complete anyways and I highly doubt that all
that time is spent on dynamic dispatch. The COM bridge and MS
Office applications seem to be the limiting factor.
I recommend to start with dynamic calls and maybe create
bindings from idl files later. If you explain what went wrong
using arsd.com maybe I or someone else can help.
Performance is my aim. In tight loops, late binding causes a
significant delay. So I decided to use early binding, at least
for MS Word. But yes, I can use a hybrid plan for other COM
objects. I actually cannot remember the exact problem I faced
with arsd.com. I was trying to use the COM object provided by
QTTabBar (my file manager plugin), but ARSD couldn't connect to
it. At that time, Adam suggested some tweaks, but they didn't
work well. I think I can reproduce the issue, and I will let you
know for sure. Thanks for your reply.