Wrong vtable for COM interfaces that don't inherit IUnknown

KytoDragon kytodragon at e.mail.de
Tue Jul 16 17:43:53 UTC 2019


On Tuesday, 16 July 2019 at 01:38:49 UTC, evilrat wrote:
> As you can see it is by design. IUnknown has different vtbl[] 
> comparing to regular D classes/interfaces. If it works with 
> declaring your own empty IUnknown use it, also you can try 
> extern(C++) which does similar thing to vtable, it might even 
> work!
...
> Oh and let me put this here...
> Have you seen this? It even has very simple xaudio example.
> https://code.dlang.org/packages/directx-d

Yes, i found that after posting. Declaring your interface 
extern(C++) and the methods in the interface extern(Windows) 
seems to do the trick. I hoped there would be a more elegant 
solution than to annotate each interface, but oh well.
Thanks anyway!


More information about the Digitalmars-d-learn mailing list